append to lists code example
Example 1: append to list python
list = ["a"]
list.append("b")
print(list)
["a","b"]
Example 2: how to append list in python
list1 = ["hello"]
list1 = list1 + ["world"]
Example 3: 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]