7/14 what is wrong?


#1

my code

animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]
duck_index = animal.index("duck")# Use index() to find "duck"
animals.insert("duck")
print duck.index

Your code here!

animals.insert(duck_index, "cobra")

print animals # Observe what prints after the insert operation

i dont under stand whats wrong

Oops, try again. Your code looks a bit off. Double check the examples in the instructions if you need help! Your code threw the following error: name 'animal' is not defined


#2

You need to use consistent spelling when you access variables.


#3
duck_index = animal.index("duck")# Use index() to find "duck"

It should be animals.index(), you spelled it without the "s".


#4

I just wanted to inform that there is a mistake in the list slicing exercise, in the code's comments it suggest to write index 2 and 3 to get elements 3 and 4 from the list, and it shlud be index 2 and 4, the same in the next comment it suggest to write index 4 and 5 to get the 5 and 6 elements and it shold be index 4 and 6.

Greatings,


#5

Thank you!!!! i got it now!