Answers for "add a value to the start of a list python"

4

add a value to the start of a list python

>>>var=7
>>>array = [1,2,3,4,5,6]
>>>array.insert(0,var)
>>>array
[7, 1, 2, 3, 4, 5, 6]
Posted by: Guest on December-02-2019

Code answers related to "add a value to the start of a list python"

Python Answers by Framework

Browse Popular Code Answers by Language