15 Iterating Over Dictionaries


what to do in part 15 Iterating Over Dictionaries

Oops, try again. It looks like you aren't using the right function. How would you print out a dictionary's .items()? (That's a hint!)

movies = {
"Monty Python and the Holy Grail": "Great",
"Monty Python's Life of Brian": "Good",
"Monty Python's Meaning of Life": "Okay"
print movies.keys()
print movies.values()


Well, read the error post for a while. There's a hint! You are using wrong methods. CC wants you to use .items() to print everything at the dict instead of just keys or values of the items.


how can i do this
how can i do this
how can i do this,


Ugh. You must print out movies using the method items() because of items() Prints out EVERYTHING in the dict, keys() and values() are for other stuff.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.