add all items from a list to another list 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 elements of a list
lst = []num = int(input('How many numbers: '))for n in range(num): numbers = int(input('Enter number ')) lst.append(numbers)print("Sum of elements in given list is :", sum(lst))