Why isn’t my Rockhopper Penguin value accepted?


#1

Question

Why isn’t my Rockhopper Penguin value accepted?

Answer

Take a careful look at the instructions and be sure to set the "Rockhopper Penguin"’s value to anything but its current value of "Arctic Exhibit".
If you think you have done this and it still doesn’t work, check that you’re properly spelling the penguin’s key name and the list name, and use brackets [] to access a dictionary key value.


FAQ: Learn Python: Python Lists and Dictionaries - Changing Your Mind
#2

Why cannot I put several deletes in one statement
e.g. del zoo_animal [“Sloth” , “Tiger”]


#3

I too, am curious if there are shorter ways for deleting multiple items?


#4

you can delete serveral things at once, but you can only do a single key lookup (to get the associated value). Knowing this, you can transform your code to:

del zoo_animals['Sloth'], zoo_animals['Bengal Tiger']