Please use Python 3
4). Write a program that asks the user to enter 10 numbers. The program should store the numbers in a list and then display the following data:
• The lowest number in the list •
The highest number in the list
•The total of the numbers in the list
• The average of the numbers in the list
Sample input & output:
(Prompt) Enter Number 1: (User enter) 4
(Prompt) Enter Number 2: (User enter) 7
(Prompt) Enter Number 3: (User enter) 3
(Prompt) Enter Number 4: (User enter) 8
(Prompt) Enter Number 5: (User enter) 4
(Prompt) Enter Number 6: (User enter) 8
(Prompt) Enter Number 7: (User enter) 3
(Prompt) Enter Number 8: (User enter) 6
(Prompt) Enter Number 9: (User enter) 12
(Prompt) Enter Number 10: (User enter) 6
(Output) The lowest number in the list is 3.0
(Output) The highest number in the list is 12.0
(Output) The sum of the numbers in the list is 61.0
(Output) The average of the numbers in the list is 6.1
numbers = [] for i in range(1, 11): numbers.append(float(input("Enter Number {}: ".format(i)))) print("The lowest number in the list is", min(numbers)) print("The highest number in the list is", max(numbers)) print("The sum of the numbers in the list is", sum(numbers)) print("The average of the numbers in the list is", sum(numbers) / len(numbers))
Get Answers For Free
Most questions answered within 1 hours.