New course! Every coder should learn Generative AI!
Try a free lesson0
Why does index= -1 inserts "java" at 2nd last position? (As generally index = -1 means end of list(
3 Answers
+ 1
That is because .insert() inserts the object before the given index, not at it :)
0
No problem :)