Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

list insert python

# Inserting multiple items in a list at a specific index
# list.insert()
myList = [1, 2, 3]
myList[1:1] = ['One', 'Two']
print(myList)
# [1, 'One', 'Two', 2, 3]
Source by www.howtouselinux.com #
 
PREVIOUS NEXT
Tagged: #list #insert #python
ADD COMMENT
Topic
Name
2+2 =