how to use append list python code example
Example 1: how to append list in python
list1 = ["hello"]
list1 = list1 + ["world"]
Example 2: python add all values of another list
a = [1, 2, 3]
b = [4, 5, 6]
a += b
# another way: a.extend(b)
list1 = ["hello"]
list1 = list1 + ["world"]
a = [1, 2, 3]
b = [4, 5, 6]
a += b
# another way: a.extend(b)