Monday, August 4, 2014

Day 121

Python at CodeCademy. Worked on Python tutorial 3 of 14, Python Lists and Dictionaries: New Neighbors! Worked on an assignment statement that replaces the item that currently holds the value "tiger" with another animal (as a string).

The code used:
zoo_animals = ["pangolin", "cassowary", "sloth", "tiger"]
# Last night our zoo's sloth brutally attacked 
#the poor tiger and ate it whole.

# The ferocious sloth has been replaced by a friendly hyena.
zoo_animals[2] = "hyena"

# What shall fill the void left by our dear departed tiger?
zoo_animals[3] = "lion"

There was no interaction for this code:

No comments:

Post a Comment