Friday, August 8, 2014

Day 125

Python at CodeCademy. Worked on Python tutorial 7 of 14, Python Lists and Dictionaries: Maintaining Order! Worked on search for an item in a list.

The code used:
animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]
duck_index = animals.index("duck")
animals.insert(duck_index, "cobra")

The interaction for this code:
['aardvark', 'badger', 'cobra', 'duck', 'emu', 'fennec fox']

No comments:

Post a Comment