Question-123: When you run below program, what would be printed
list = [1, 2, 3, 4, 5]
emptyList = []
sum = 0
for i in list:
sum += i
emptyList.append(sum)
print(emptyList)
- 14
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Answer: C
Exp: In program, we are adding current element with previous elements sum. And putting element in another list. Hence,
You can access to full explanation to question and answer from this page.