Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

insert list python

l = list(range(3))
print(l)
# [0, 1, 2]

l.insert(0, 100)
print(l)
# [100, 0, 1, 2]

l.insert(-1, 200)
print(l)
# [100, 0, 1, 200, 2]
Source by www.howtouselinux.com #
 
PREVIOUS NEXT
Tagged: #insert #list #python
ADD COMMENT
Topic
Name
6+8 =