Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python insert object into list

# list.insert(before, value)
list = ["a", "b"]
list.insert(1, "c")
print(list)     	# ['a', 'c', 'b']
# at the end: list.append(value)
list.append("d")	# ['a', 'c', 'b', 'd']
 
PREVIOUS NEXT
Tagged: #python #insert #object #list
ADD COMMENT
Topic
Name
1+6 =