Oops, try again. Make sure to pass duck_index as the first argument in insert().

animals.insert(2, "cobra")


use the duck_index variable when inserting, not a fixed number, this will make your code more flexible and robust


when you do the duck_index = .index('duck')
you created a variable. What that variable does is locate the exact position of the word "duck".

animals.insert(duck_index, "cobra")

since you do not know the exact number for the location of "duck" the variable does it for you, hence why you put it in the index place instead of a number.....


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