Maintaining Order [can some one help]


#1

animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]
duck_index = animals.index("duckUse index() to find "duck"
animals.insert(duck_index,"cobra")# Your code here!
print animals # Observe what prints after the insert operation

#2

this line:

duck_index = animals.index("duckUse index() to find "duck"

the first bit is code:

duck_index = animals.index("duck

then after it there are instructions:

Use index() to find "duck"

remove the instructions and finish the code.


#3

I did the same mistake, English is not my prime language so maybe that why.

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

animals.insert(duck_index, "cobra") Try this.


#4

by jakhal:stuck_out_tongue:


#5

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