Eroor message


#1



`python


kindly guide what is wrong with my code.first give hint so that i can try and after that only tell full solution


#2

insert() will update the list, and return None, so don't store the result of this action in duck_index variable


#3

sir ,but goal of this excercise is not to return" None", i suppose.even if i modify the code duck_index=insert(2,"cobra"), i am still getting error message.So where is my approach going wrong.Kindly throw some light on it.also when i am running the above code in repl.it,it does not show any error.


#4

sir now i got your point, the code works fine when i drop duck_index . and write simply animals.insert(duck_index,"cobra").But in the excersice it is asked - Then .insert(index, item) the string "cobra" at that index.
anyone will interpret that we have to use insert command for duck_index isn't it.thats why error will pop up.


#5

which means you should use duck_index as first argument for .insert(), the instructions are fine

Good you figured it out :slight_smile:


#6