A
Q. What will be the output of following python code?
Code:
a=[1,2,3,4]
b=[sum(a[0:x+1]) for x in range(0,len(a))]
print(b)
b=[sum(a[0:x+1]) for x in range(0,len(a))]
print(b)
- Correct Answer - Option(D)
- Views: 28
- Filed under category Python
- Hashtags:
Discusssion
Login to discuss.