Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python list add element to front

# list.insert(before, value)
list = ["a", "b"]
list.insert(0, "c")
print(list)     # ['c', 'a', 'b']
 
PREVIOUS NEXT
Tagged: #python #list #add #element #front
ADD COMMENT
Topic
Name
1+3 =