add one in all elements of a list python code example
Example 1: add 1 to all elements in list python
lst = [1,2,3]
list(map(lambda x:x+1, lst))
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))