Hi im a beginner in python and need some advice with this code. I want to get the sum of the previous values
D = {1:[90,3,'a'], 2:[270,2,'b'], 3:[30,2,'c']}
n = 0
xend = 0
for d in D.values():
n += 1
if n == 1:
xstart = 0
xend += d[0]
xstart += xend
I want to get the value of xstart for each iteration as the sum of the previous values in list index 0. for eg, when d = [90,3,'a'], xstart = 0. when d = [270,2,'b'], xstart = 90. when d = [30,2,'c'], xstart = 360. and so on. Help would be appreciated!