Question: 4 . Implement letter _ grades Read the specification of the function letter _ grades in the module funcs. Implement this function according to its

4. Implement letter_grades
Read the specification of the function letter_grades in the module funcs. Implement this function according to its specification. Once again, the inputs to this function must be dictionaries that have netids as keys and numbers as values. Look at the test cases in tests.py if you are unsure.
When you have implemented the function, test your answer with the test script. You should now pass all tests.
def letter_grades(adict):
"""
Returns a new dictionary with the letter grades for each student.
The dictionary adict has netids for keys and numbers 0-100 for values. These
represent the grades that the students got on the exam. This function returns a
new dictionary with netids for keys and letter grades (strings) for values.
Our cut-off is 90 for an A,80 for a B,70 for a C,60 for a D. Anything below 60
is an F.
Examples:
letter_grades({'wmw2' : 55, 'abc3' : 90,'jms45': 86}) returns
{'wmw2' : 'F, 'abc3' : 'A','jms45': 'B'}.
letter_grades({}) returns {}
Parameter adict: the dictionary of grades
Precondition: adict is dictionary mapping strings to ints
"""
pass

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!