KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Write a Python program to add all the elements of the list.

Python List Manipulation

2 Likes

Answer

numbers = [2, 3, 4, 5, 7]
total = 0
for i in numbers:
    total = total + i
print("Sum of elements:", total)

Output

Sum of elements: 21

Answered By

1 Like


Related Questions