Question: Program 2 9 : Write a program which : Writes a random number ( 5 0 to 5 5 ) of numbers ( 0 to

Program 29:
Write a program which :
Writes a random number (50 to 55) of numbers (0 to 100) 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: 1,1,2,5,6,6,9 the median is 5.
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: 1,1,2,6,6,9 the median is 4.
The middle two values are 2 and 6, so (2+6)/2=8/2=4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!