Header Ads Widget

Python program to find the sum of all the element of the list.

 Code :-


print("enter element of list")
mylist = list(map(int, input().split()))
sum = 0
for i in mylist:
sum = sum + i

print("sum of all element is", sum)

Output:-


enter element of list
12 3 4 5 6 7 8 8 9
sum of all element is 62