I am a beginner in python programming. I am trying to perform cumulative addition on values of a list.
values=[1,2,3]
for i in range(len(values)):
print(sum(values[0:i]))
Output is
0
1
3
Whereas I am expecting a list with output [1,3,6]
Please can you someone guide me which part of my code is wrong? I don't wish to use accumulate() function.