Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started