Question: Consider the following scenario about using Python dictionaries:A teacher is using a dictionary to store student grades. The grades are stored as a point value
Consider the following scenario about using Python dictionaries:A teacher is using a dictionary to store student grades. The grades are stored as a point value out of Currently, the teacher has a dictionary setup for Term grades and wants to duplicate it for Term The studentname keys in the dictionary should stay the same, but the grade values should be reset to Complete the "setupgradebook" function so that input like J ames": "Felicity": "Barakaa": o willproduce a resulting dictionary that contains James: "Felicity": "Barakaa": This function should: accept a dictionary "oldgradebook" variable through the function's parameters; make a copy of the "oldgradebook" dictionary; iterate over each key and value pair in the new dictionary; replace the value for each key with the number ; return the new dictionaryedef setup gradebook old gradebook :# Use a dictionary method to create a new copy of the "old gradebook".# Complete the for loop to iterate over the new gradebook.for# Use a dictionary operation to reset the grade values to ereturn new gradebookfallgradebook James : "Felicity" : "Barakaa": printsetupgradebook fallgradebook# Should output ampc
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
