Python code
=====================================================================================
count=0
for i in range(56,21,-1):
if i%2==1:
count=count+1
print('There are ',count, 'odd numbers')
=====================================================================================
Output
Python code
=====================================================================================
count=0
for i in range(56,21,-1):
if i%2==1:
count=count+1
print('There are ',count, 'odd numbers')
=====================================================================================
Output
Use python please! Thank u 5. Write a program to determine (not by counting yourself!) how...
Please use Python for this program Random Number File Writer Write a program that writes a series of random numbers to a file. Each random number should be in the range 1 through 500. The program should let the user specify how many random numbers to put into the file. The name of the file to write to should be 'random.txt'. Submit the random.txt file generated by your program with the assignment. Sample program execution: Python 3.4.3 Shell Eile Edit...
USE PYTHON: 4) [30pts] Write program which finds the followings for the given values between 150 to 1000 a) How many odd numbers are between 150 and 1000 (include 150 and 1000) b) Find the sum of odd numbers which are between 150 and 1000 (include 150 and 1000) c) Find the multiplication of odd numbers which are between 150 and 1000 (include 150 and 1000) d) Find the sum of square of odd numbers which are between 150 and...
Please use Python 3, thank you~ Write a program that: Defines a function called find_item_in_grid, as described below. Calls the function find_item_in_grid and prints the result. The find_item_in_grid function should have one parameter, which it should assume is a list of lists (a 2D list). The function should ask the user for a row number and a column number. It should return (not print) the item in the 2D list at the row and column specified by the user. The...
I need this in python thank you 10.3 Code Practice Instructions Write a program that creates a 4 x 5 array called numbers . The elements in your array should all be random numbers between -30 and 30, inclusive. Then, print the array as a grid. For instance, the 2 x 2 array [[1,2],[3,4]] as a grid could be printed as: 1 2 34 Sample Output 18 -18 10 0 -7 -20 0 17 29 -26 14 20 27 4...
Please help with this python assignment. Thank you. question 1 Write a Python program to read a file line by line store it into a variable. question 2 Write a Python program to read a file line by line store it into an array. question 3 Write a python program to find the longest words. question 4 Write a Python program to count the number of lines in a text file. question 5 Write a Python program to count the...
please write in python Write a program that asks for beginning and ending number. The program generates a set of 20 random numbers between the numbers and displays a count of each number generated. Sample output Enter starting and ending number separated by comma: 5, 25 5 occurs 2 times 7 occurs 1 time 8 occurs 1 time 10 occurs 2 times 12 occurs 1 time 13 occurs 2 time 15 occurs 5 times 16 occurs 1 time 20 occurs...
Use python and use if, elif and else statements. Thank you! The program should first ask the user if they are a hero or a villain. If they enter “villain”, the program should ask them their name; if they enter “hero”, it should ask how many people they have saved, and respond to that information. Using decision structures, have your program execute certain print statements following these rules: If they enter that they are a villain Ask for their name...
5. Write a program in, "Python" that reads 2 numbers from the user. The program should then print out whether the first number is evenly divisible by the second number.
Question 4-6 Please. Python 3.6. def main(). entered by a user. Write a program that finds the sum and average of a series of numbers he program should first prompt the user to enter total numbers of numbers are to be summed and averaged. It should then as for input for each of the numbers, add them, and print the total of the numbers and their average 2. Write a progra m that finds the area of a circle. The...
please solve using python thank you! Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * *...