Maintaining Order


#1



https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/4?curriculum_id=4f89dab3d788890003000096


Make sure to pass duck_index as the first argument in insert().


animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]
duck_index = animals.index("duck")   # Use index() to find "duck"
# Your code here!
animals.insert(2,"cobra")


print animals # Observe what prints after the insert operation


#2

you should use duck_index here, not a fixed number


#3

The code works when you put: animals.insert (duck_index, "cobra"). I think this was very misleading, because the examples use the index number vice the variable.
Code Academy, YOU HAVE GOT TO FIX YOUR INSTRUCTIONS!!!!!!!!!!! PLEASE!!!!!!


#4

if the example already shows exactly the code, you might learn to code eventually, but you will never learn to program


#5

Thanks for your help :smile:


#6