Question: ( USING PYTHON ) Write a program that given a collection of N numbers will find the smallest value, its frequency and the average of
(USING PYTHON) Write a program that given a collection of N numbers will find the smallest value, its frequency and the average of the N numbers.
-
Get the value of N from the user.
-
If 0N0, display an appropriate error message and terminate the program; otherwise
-
Read the values as entered from the user. (If =5N=5, then there are 5 values the user is going to enter).
-
Find the smallest, its frequency (how many times it is repeated) and the average of these N values.
-
Hint: To find the smallest value, read the first value before the loop then assume that this first value entered by the user is the smallest value. Within the loop compare the assumed smallest value with other values read inside the loop and change the smallest value accordingly.
-

Exercise # 2: Write a program that given a collection of N numbers will find the smallest value, its frequency and the average of the N numbers. . Get the value of N from the user. If N 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
