append at an index in python code example
Example 1: append to lists python
list = [] ## Start as the empty list
list.append('a') ## Use append() to add elements
list.append('b')
Example 2: append to lists python
list = [1, 2, 3]
print list.append(4) ## NO, does not work, append() returns None
## Correct pattern:
list.append(4)
print list ## [1, 2, 3, 4]