*****python help****** Write a program to ask the user as to how many numbers th
ID: 3878249 • Letter: #
Question
*****python help******
Write a program to ask the user as to how many numbers they want to enter. your program should collect that many numbers from the user and find the smallest and Average of those numbers. For example, if the user says, he/she wants to enter 6 numbers, you should collect 6 numbers. You can accomplish this by looping 6 times, collecting one number each time you are in the loop. Hint1: You can use the while loop to write this program Hint2: Study the program which calculates the largest of the 10 numbers.
Explanation / Answer
array = []
number = int(input('How many numbers need to be entered: '))
total = 0
for i in range(0,number):
print(' ')
numb = int(input('Enter the numbers: '))
array.append(numb)
total = total + numb
average = total / number
print(' ')
print('Smallest number is =',min(array))
print("Average =", round(average,2))
OUTPUT
How many numbers need to be entered: 4
Enter the numbers: 4
Enter the numbers: 3
Enter the numbers: 2
Enter the numbers: 6
('Smallest number is =', 2)
('Average =', 3.0)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.