how to find sum in python code example
Example 1: how to add list numbers in python
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))
Example 2: python sum
a = 3
b = 5
c = sum (a + b)
print(c)