Instagram
youtube
Facebook
Twitter

Python Program to Find Sum of List Elements

   Python Program to Find Sum of List Elements
    Short Description of the Program:

This Python program calculates the sum of all elements in a list using a for loop. It iterates through each item in the list, adds them to a sum variable, and finally prints the total sum.

Short Explanation:

• A list of numbers is defined.
• A variable sum is initialized to 0.
• A loop goes through each item in the list and adds it to sum.
• After the loop, the total sum is printed.

Program:

my_list = [11,22,33,44,55,66,77,88,99,100]

sum = 0

for item in my_list:

    sum += item

print('This is sum of element: ',sum)