Answers for "append at begining of list"

41

python append to start of list

lst = ["f", "o", "o", "b", "a","r"]
lst.insert(0,"b")
print(lst) # ["b", "f", "o", "o", "b", "a", "r"]
Posted by: Guest on December-09-2021
0

list adding to the begining python

a=5

array = [2,3,4,5,6]

array.insert(0,a)

print(array) 
Posted by: Guest on March-20-2021

Code answers related to "append at begining of list"

Python Answers by Framework

Browse Popular Code Answers by Language