Eroor message



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


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


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,it does not show any error.


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.


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

Good you figured it out :slight_smile: