Question

In Python, how to insert a new element in the list at a given index?


Annonce
Ad

Answer

>>> myList = [10,20,30,50]
>>> myList.insert(3,40)
>>> myList
[10, 20, 30, 40, 50]


[source]
# ID Query