Question: Python 4. Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers
Python
4. Number Analysis Program
Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in a list and then display the following data:
1. The lowest number in the list
2. The highest number in the list
3. The total of the numbers in the list
4. The average of the numbers in the list
def main(): numbers = get_values() # get_values() # not needed, you already called it get_analysis(numbers) def get_values(): values = [26, 45, 56, 12, 78, 74, 39, 22, 5, 90, 87, 32, 28, 11, 93, 62, 79, 53, 22, 51] for i in range(20): values.append(values) # append value not values, simple typo, but it makes a difference return values def get_analysis(numbers): # your parentheses are in the wrong place http://docs.python.org/3.1/library/functions.html#print print("The Lowest Number Is:", min(numbers)) # print("The Lowest Number Is: ") + str(min(numbers)) print("The Highest Number Is:", max(numbers)) # print("The Highest Number Is: ") + str(max(numbers)) print("The Sum The Numbers Is:", sum(numbers)) # print("The Sum The Numbers Is:") + str(sum(numbers)) print("The Average The Numbers Is:", sum(numbers) / len(numbers)) # print("The Average The Numbers Is: ") + str(sum(numbers)/len(numbers)) main()
Here's my code.. I need help making this work?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
