Write a Python program to sum all the items in a list

def sum_all(lst):
    sum = 0
    for i in lst:
        sum += i
    return sum

list1 = [1, 2, 3, 5, 8]

print(sum_all(list1))


Follow on:
Sunil Shaw

Sunil Shaw

About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.

Related Page