Question-121: When you run below program, what would happen or printed?
list=[1,3,5,-7,9 ]
sum=0
for i in list:
sum=sum+i
print( sum)
- 25
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Answer: This is a simple iteration on the elements of a list. And each element is added to generate final sum. So
You can access to full explanation to question and answer from this page.