Introduction to lists


#1



introuction to lists

it puts what i belive to eb the correct output, but i get an error called "error 3"


zoo_animals = { "Panda" : "Panda livin Place",
"Sloth" : "Rainforest Exhibit",
"Bengal Tiger" : "Jungle House",
"Atlnatic Puffin" : "Artic Exhibit",
"Rockhopper Penguin" : "Artic Exhibit"}

del zoo_animals["Sloth"]
del zoo_animals["Bengal Tiger"]
zoo_animals["Rockhopper Penguin"] = "Ice House"

print zoo_animals


#2

Hi on what lesson are you ?


#3

python lists and dictionaries


#4

And thw name of the lesson is it Changing Your Mind?


#5

On taht Lesson you begin with that code

# key - animal_name : value - location 
zoo_animals = { 'Unicorn' : 'Cotton Candy House',
'Sloth' : 'Rainforest Exhibit',
'Bengal Tiger' : 'Jungle House',
'Atlantic Puffin' : 'Arctic Exhibit',
'Rockhopper Penguin' : 'Arctic Exhibit'}
# A dictionary (or list) declaration may break across multiple lines

# Removing the 'Unicorn' entry. (Unicorns are incredibly expensive.)
del zoo_animals['Unicorn']

# Your code here!




print zoo_animals

then the instructions says..

Delete the Sloth and Bengal Tiger items from zoo_animals using del.

Set the value associated with Rockhopper Penguin to anything other than Arctic Exhibit.
and you did the first thungs they aske you...

del zoo_animals["Sloth"]
del zoo_animals["Bengal Tiger"]

but that one isn't right

zoo_animals["Rockhopper Penguin"] = "Ice House"

and you should have that on your code

# Removing the 'Unicorn' entry. (Unicorns are incredibly expensive.)
del zoo_animals['Unicorn']