Question: I am getting the following error The call drop_below({'abc123': 0, 'abc456': 65, 'jms457': 50, 'jms123': 60, 'xyz123': 70, 'xyz456': 80, 'wmw4': 90, 'wmw5': 100, 'tor3':

I am getting the following error

The call drop_below({'abc123': 0, 'abc456': 65, 'jms457': 50, 'jms123': 60, 'xyz123': 70, 'xyz456': 80, 'wmw4': 90, 'wmw5': 100, 'tor3': 88}, 20) did not modify the dictionary.

I'm not sure how to fix this issue.

def drop_below(adict,limit): """ Deletes all students in the dictionary with grades below limit. The dictionary adict has netids for keys and numbers 0-100 for values. These represent the grades that the students got on the exam. Examples: Suppose a = {'wmw2' : 55, 'abc3' : 90, 'jms45': 86} drop_below(a,60) changes a to {'abc3' : 90, 'jms45': 86} drop_below(a,90) changes a to {'abc3' : 90} drop_below(a,95) changes a to {} drop_below(a,50) leaves a unchanged as {'wmw2' : 55, 'abc3' : 90, 'jms45': 86} Parameter adict: the dictionary of grades Precondition: adict is dictionary mapping strings to ints Paramater limit: the cut-off boundary Precondition: limit is a number (int or float) """ # Hint: Create a list of netids to drop, and THEN drop them droplist=[key for key in adict if adict[key]

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!