"This Next Part is Key" - 'dict' object is not callable


#1

Well, that's exactly what it says.

My solution for "This Next Part is Key" would be:

print residents ['Sloth'] residents ['Burmese Python']

And then it tells me that the dict object is not callable.

What shall I do?


#2

@boardrockstar90452,
could you present the full code which you are using.....??

edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use
= http://discuss.codecademy.com/t/using-backticks-to-format-your-code/3697


#3

Is print residents ['Sloth'] residents ['Burmese Python'] all on one line?

I did it like this instead:

print residents['Puffin']
print residents['Sloth']

and it worked fine for me.


#4

We can only print on one line if we group the items in a comma separated list or tuple...

print (residents['Sloth'], residents['Burmese Python'])

Be sure not to include white space between the identifier and the subscript block...

    identifier[subscript]