Answers for "add element in the beginning of the list python"

4

append to front of list python

var = 7
array = [1,2,3,4,5,6]
array.insert(0,var)
print(array)
# [7, 1, 2, 3, 4, 5, 6]
Posted by: Guest on March-29-2020

Code answers related to "add element in the beginning of the list python"

Python Answers by Framework

Browse Popular Code Answers by Language