0
While using the insert function is it mandatory to the word index itself?
2 Réponses
+ 1
I think I know what you're thinking of, in the example SoloLearn gave they used the word "index". Well if you look at the example again you can see that they said
index=1
So rather than using index, use a number. The number is supposed to represent where you want to insert it.
+ 1
Exactly as darth said, index represents the place at which you would like the number to be inserted. For example,if we have ,
list=[1,2,4,6]
list.insert (2,8)
print(list)
The output will be
[1,2,8,4,6]
where 8 is inserted at 2nd index.