Question: 3: Grades Write a function, final_grade_ranking that takes two inputs: a dictionary (containing students as keys and a list of grades of length n) and

 3: Grades Write a function, final_grade_ranking that takes two inputs: a

3: Grades Write a function, final_grade_ranking that takes two inputs: a dictionary (containing students as keys and a list of grades of length n) and a set of weights for each assignment (the set of weights is also of length n). The output is a list of pairs (students names, grade) sorted by the weighted average. For example, here if there were three assignments, and four students the dictionary might be given by grades and the weights by weights , in the cell below. The weights can be thought of as percentages. The output should be [('terri', 51), ('sherry', 54), ('kerry', 75), ('jerry', 78), ('harry', 79)] Hint: Construct a function final_grade that calculates a final grade from the list of assignments and the weights. Then, use that function in the final_grade_ranking as the key on which to sort the list. In [ ]: grades = { 'terri': [55,90,10], 'kerry': [88,66,77], 'sherry': [70, 90,10], 'jerry': [90, 60, 90], 'harry': [0, 100, weights [20,40,40] = In [ ]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!