# Write a function that takes a list of grades # Each item (in the list of grades) contains grades for each course # the student took. # The function returns a list of averages of the courses. # Example: # list_of_grades = [[80, 90], [90, 89, 97], [75, 90, 100], [70, 75, 90, 85]] # the function returns averages = [85.0, 92.0, 83.33, 80.0] def compute_averages(lst): """ The function takes a list of grades and returns a new list in which each item is the average of the grades for each course """ list_avg = [] for course_grade in lst: total = 0 for grade in course_grade: total += grade avg = total / len(course_grade) list_avg.append(avg) return list_avg list_of_grades = [[80, 90], [90, 89, 97], [75, 90, 100], [70, 75, 90, 85]] print(compute_averages(list_of_grades))