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=[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]
Answer: Option D
Join The Discussion