Question: Write a Python program: * Program will use a text file data_xxxxxxx.txt to write 15 numbers in the range of 0 to 100 (one number
Write a Python program:
* Program will use a text file data_xxxxxxx.txt to write 15 numbers in the range of 0 to 100 (one number in each line), where xxxxxxx represents your ID number.
* Then the program will read these values into a list named numbers.
* Call a function get_average( ) and pass the list to it. The function will calculate and return the average back.
* Call a function sort_list( ) to sort scores in the list in ascending order - use any popular algorithm such as bubble sort, insertion sort or merge sort.
* Call a function get_max( ) and pass the list to it. The function will find the highest score and return it back.
* Call a function get_min( ) and pass the list to it. The function will find the lowest score and return it back.
(Your program will not use any pre-written Python functions to find average, max and min. You will write logic for the same)
* Append average, maximum and minimum scores in separate lines into the text file data_xxxxxxx.txt with appropriate messages such as "average score is 90"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
