15 Iterating Over Dictionaries


#1

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()


#2

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.


#3

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


#4

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.


#5

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