'Maintaining Order' says cobra is in the wrong place


animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]

duck_index = animals.index("duck")


print animals

This puts cobra before duck. Error message says Cobra's in the wrong spot. I've tried using numbers to put cobra everywhere. What's wrong with this code?


cobra should have a lowercase c


It works! I put a lowercase and it works.I usually hate not capitalizing but for this i had to


animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]
duck_index = animals.index["duck"]

# Use index() to find "duck"

animals.insert[duck_index, 'cobra']

print animals
what am i doing wrong can you tell me


both index() and insert() are method so they require parentheses, not square brackets


thanks man,it works.i didn't see that