Question: Program 2 9 : Write a program which : Writes a random number ( 5 0 to 5 5 ) of numbers ( 0 to
Program :
Write a program which :
Writes a random number to of numbers to in a file
Opens the file and reads the numbers from it into a list
Sorts the list and Shows it
Calculates the median.
Note: You may NOT use the Python built in functions: sort sorted sum median
See the lecture videoLinks to an external site. about files for hints.
Hint to calculate median:
If there is an odd number of data values then the median will be
the value in the middle.
For the data set: the median is
If there is an even number of data values then the median will be
the average of the two data values in the middle.
For the data set: the median is
The middle two values are and so
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
