Need help 10. New entries


#1

I need help with New entries.
Here is my code:

residents = {'Puffin' : 104, 'Sloth' : 105, 'Burmese Python' : 106}

print residents['Puffin']

print residents [105, 106]

END CODE
It says: Traceback (most recent call last) :
File "python", line 6, in
KeyError: (105, 106)

Oops, try again. Check to make sure you spelled the key strings correctly!

Could someone pls help cause I don't understand


#2

Meant to say 10. This next part is key


#3

105 and 106 are not keys. They are values to the keys 'Sloth' and 'Burmese Python' respectively.
Dictionary syntax goes like

dictionary = {key:value(s), key:value(s), key:value(s),...}

#4

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