Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
add a value to the start of a list python
Wade
Programming language:
Python
2021-07-08 15:19:25
0
Q:
add a value to the start of a list python
Ieva Pereslegina
Code:
Python
2021-07-15 03:45:07
>>>var=7 >>>array = [1,2,3,4,5,6] >>>array.insert(0,var) >>>array [7, 1, 2, 3, 4, 5, 6]
3
Tags
python
value
list
add
start
Related
how to add a new element to a list in python
how to add item to a list python
python add item to list
add item to list python
python add item to list at specific index
how to add a value to a list in python
how to add an item to a list python
python add to start of list
add item to list at the end python
how to add an item to a list in python
python add to list with index
how to add to the end of an array python
insert item into list python
add to a list python
add an element to list python
python add to list
add element to list python at index
for loop python start at 1
New to Communities?
Join the community