push element to index list python code example
Example 1: how to add an item to a list python
numbers = [1, 2, 3, 4]
numbers.append(10)
print(numbers)
Example 2: append to list at index python
#!/usr/bin/python
aList = [123, 'xyz', 'zara', 'abc']
aList.insert( 3, 2009)
print "Final List : ", aList