https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/4?curriculum_id=4f89dab3d788890003000096


#1



https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/4?curriculum_id=4f89dab3d788890003000096

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


animals.insert(2, "cobra")


#2

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


#3

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.....


#4

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