how to add all the elements of a list in another in python code example
Example 1: add all items in list to another list python
a = [1]
b = [2,3]
a.extend(b)
print(a)
------ OR -------
a += b
Example 2: python add all values of another list
a = [1, 2, 3]
b = [4, 5, 6]
a += b
# another way: a.extend(b)