Question: ***PYTHON 3*** 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
***PYTHON 3***

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 f jerry', 51.0), ('larry', 54.0), ('kerry', 75.0), ('mary', 78.0)] 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. Double Hint: You first create a list of student names rank_names appropriately sorted, then create a list of the associated grades, mapped_grades using map (See the sortByExval function is PS2). You can then combine these two lists to get the correct output using list(zip(rank_names, mapped_grades)) grades = { jerry': (55,90,10], 'kerry': [88,66,77], 'larry': [70, 90,10], 'mary': [98, 60, 90]} weights = [20,40,40]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
