Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

6. What is moral hazard? How do banks reduce this problem? LOP8

Answered: 1 week ago