Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4 . Implement letter _ grades Read the specification of the function letter _ grades in the module funcs. Implement this function according to its
Implement lettergrades
Read the specification of the function lettergrades 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 lettergradesadict:
Returns a new dictionary with the letter grades for each student.
The dictionary adict has netids for keys and numbers 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 cutoff is for an A for a B for a C for a D Anything below
is an F
Examples:
lettergradeswmw : 'abc : jms: returns
wmw : F 'abc : Ajms: B
lettergrades 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started