Question: 2 . 4 Map Scores to Grades For all further problems please use the dictionary averages listed below: averages = { Alice: 8 4 .
Map Scores to Grades
For all further problems please use the dictionary averages listed below:
averages "Alice": "Bob": "Charlie": "David":
Write a function mapscorestogrades that maps each students average score to a letter grade A B C D or F Use the map function with a lambda function.
Grading system:
and above: A
to : B
to : C
to : D
Below : F
Hint: The map function applies a given function to all items in the list or dictionary.
Use a lambda function inside map to convert each students average into a letter grade.
To apply the map function to a dictionary, you can use averages.items to get keyvalue pairs student average
def mapscorestogradesaverages:
# Add your code here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
