Python program to calculate the sum of elements in a list

Spread the love

In this tutorial you will learn, how to write Python program to calculate the sum of elements in a list

Step 1 : Create a list with values

Step 2 : Use predifined function sum() to find sum of the list of values and then assign to result variable

Step 3: print result value.

l = [15,16,17,17,19,20]

result=sum(l)

print(result)

Output:

104

admin

admin

Leave a Reply

Your email address will not be published. Required fields are marked *