This is KEY!


#1



https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/0/2?curriculum_id=4f89dab3d788890003000096#


Traceback (most recent call last):
File "python", line 13, in
TypeError: 'dict' object is not callable


I am not sure what I have done wrong and I can't find the 'dict' that the error message is referring to. Can anyone help?


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 key in webster:
    print webster("Aardvark", 
    "Baa", 
    "Carpet", 
    "Dab")


#2

The dictionary in question is, webster. However this line is trying to call it like a function...

print webster("Aardvark", "Baa", "Carpet", "Dab")

#3

im also having problems with this, the same error pops up


#4

The purpose of the for loop is the cycle through each item in the dictionary and print one key and value pair on each pass.


for each_key in webster:
    print each_key, webster[each_key]

#5

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