15 Program to sum all the items in a list using Python

Program:

l = list()
l = [int(x) for x in input("Enter any 5 value: ").split()]
sum = 0
for i in l:
    sum = sum + i

print("Sum:",sum)


Output:

Program to sum all the items in a list using Python

Previous
Next Post »