0
6.2kviews
Write a python program to find the sum of all the elements of the list.
1 Answer
written 2.6 years ago by |
Explanation
Code:-
l= []
ele=0
total=0
n = int(input("Enter number of elements : "))
for i in range(0, n):
print("Enter elements:")
ele = int(input())
l.append(ele)
print(l)
for ele in range(0, n):
total = total + l[ele]
print("Sum of all elements in the list: ", total)
Output:-