Prints out a value of none instead of duck_index


#1



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

# Your code here!
duck_index = animals.insert(duck_index, "cobra")


print animals # Observe what prints after the insert operation


This code keeps printing out a value of none instead of duck_index. What is missing?
I got it it was animal.index(2, "cobra"). No assistance is needed on this task. I do not wish to waist any ones time.


#2

it prints out the list, i ran your code here, and everything is fine?


#3

@leuno, try refreshing the page. I've had this issue a couple of times before and refreshing the page helps.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.