2. this is key!


webster = {
"Aardvark" : "A star of a popular children's cartoon show.",
"Baa" : "The sound a goat makes.",
"Carpet": "Goes on the floor.",
"Dab": "A small amount."

Add your code below!

for d in webster:
print webster[d]
I don't understand why this prints out the definition


Hello, @joey4242!
Whenever we iterate through a dictionary, we'll access the keys and if we want to print them all we have to do is:

for dictionaryKey in webster:
     print dictionaryKey

But if we want to print the value stored into that key, we'll have to print


This is due the fact you're iterating through the keys and whenever you do this, you're saying:
"In this dictionary, webster, access the key value stored in dictionaryKey and print out the value in it."

Hope it's clear now!

Best regards,


so it goes (key : value) ??


so the code:

will give me the (:value) ???


Yes, that's how dictionaries work.
To print the key, all you have to do is to print the variable you are using to iterate through the dictionary but if you want to print the value, use name_of_the_dictionary[name_of_the_key]


Yes, it will get you the value.