logic: read list using for loop and add all its elements together and, In end print all the iteration value together in the list
input
lis=[1,1,1,1,1]
ore=[]
for t in lis:
ore.append(sum(lis[0:lis.index(t)+1]))
print(ore)
output
[1, 1, 1, 1, 1]
expected
[1,2,3,4,5]
I have no idea why I am getting output like this one, also want to know about the mechanism of this kind of output. Any possible help is appreciated.