elsemedian nums[midposreturn median def main()print("this program computes meanmedian and standard deviation "data getnumbers(xbar mean(datastd stddev(dataxbarmed median(dataprint("\nthe mean is"xbarprint("the standard deviation is"stdprint("the median is"medif __name__ ='__main__'main( lists of records all of the list examples we've looked at so far have involved lists of simple types like numbers and strings howevera list can be used to store collections of any type one particularly useful application is storing collection of records we can illustrate this idea by building on the student gpa data processing program from last recall that our previous grade processing program read through file of student grade information to find and print information about the student with the highest gpa one of the most common operations performed on this kind of data is sorting we might want the list in different orders for different purposes an academic advisor might like to have file with grade information sorted alphabetically by the name of the student to determine which students have enough credit hours for graduationit would be useful to have the file in order according to credit-hours and gpa sort would be useful for deciding which students are in the top of the class let' write program that sorts file of students according to their gpa the program will make use of list of student objects we just need to borrow the student class from our previous program and add bit of list processing the basic algorithm for our program is very simple get the name of the input file from the user read student information into list sort the list by gpa get the name of the output file from the user write the student information from the list into file let' begin with the file processing we want to read through the data file and create list of students here' function that takes filename as parameter and returns list of student