logo CodeStepByStep logo

dict_tracing1

Language/Type: Python collections dict

What keys and values are contained in the following dictionary after this code executes?

people = {}
people[7] = "Marty"
people[34] = "Louann"
people[27] = "Donald"
people[15] = "Moshe"
people[84] = "Larry"
people[7] = "Ed"
people[2350] = "Orlando"
del people[7]
people[5] = "Moshe"
del people[84]
people[17] = "Steve"

(Though dictionaries store their contents in unpredictable order, for this problem, write the pairs sorted by numeric value of the keys, in the format {key: 'value', key: 'value'}.)

dictionary contents

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.