Q118
What will be the output of the following Python code? a=[1,2,3,4] b=[sum(a[0:x+1]) for x in range(0,len(a))] print(b)
A.
10
B.
[1,3,5,7]
C.
4
D.
[1,3,6,10]
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board