data collections from gpa import studentmakestudent def readstudents(filename)infile open(filename' 'students [for line in infilestudents append(makestudent(line)infile close(return students def writestudents(studentsfilename)outfile open(filename' 'for in studentsprint("{ }\ { }\ { }format( getname() gethours() getqpoints())file=outfileoutfile close(def main()print("this program sorts student grade information by gpa"filename input("enter the name of the data file"data readstudents(filenamedata sort(key=student gpafilename input("enter name for the output file"writestudents(datafilenameprint("the data has been written to"filenameif __name__ ='__main__'main( designing with lists and classes lists and classes taken together give us powerful tools for structuring the data in our programs let' put these tools to work in some more sophisticated examples remember the dieview class from last in order to display the six possible values of dieeach dieview object keeps track of seven circles representing the position of pips on the face of die in the previous versionwe saved these circles using instance variablespip pip pip etc let' consider how the code looks using collection of circle objects stored as list the basic idea is to replace our seven instance variables with single list called pips our first problem is to create suitable list this will be done in the constructor for the dieview class