?
What will be the output of the following Python code?
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)
Join the Discussion
Login to post a comment or share your explanation.
Login