# Students are to complete the work in two places noted as TO-DO #from array_list import Array2D from array import Array2D filename = 'data.txt' # Open the text file for reading. grade_file = open( filename, "r" ) # Extract the first two values; indicate the size of the array. num_students = int( grade_file.readline() ) num_exams = int( grade_file.readline() ) # Create the 2-D array to store the grades. exam_grades = Array2D( num_students, num_exams ) # print('n_students ', num_students, 'n_exams ', num_exams) # Extract the grades from the remaining lines. # TO-DO: use a loop to read one line at a time and extract the grades # Close the text file. grade_file.close() # Compute each student's average exam grade. print("Student Grade") for i in range( num_students ) : # TO-DO: compute and print the average for each student print( "%2d: %6.2f" % (i+1, exam_avg) )