# Python list - Insert the object at the first position

You can insert the element at the first position in the list.

a = ['Apple', 'Microsoft', 'Amazon', 'Google', 'Facebook', 'NVIDIA']

a.insert(0, 'Tesla')



The insert() inserts the object to the list and the first argument is the inserted index. If you want to insert at the last position, use the append method.

## Use of collections.deque

from collections import deque

d = deque(a)

d.appendleft('Tesla')

for i in d:
print(i)

# Tesla
# Apple
# Microsoft
# Amazon

The deque object has the appendleft() method that is similar to insert(0, x).