First of all I'm not good at English please be kind to me. I've a trouble about my code. I need to substract previous list index from current list index.
Let me show you an example with my code;
xvalues = [1,1,2,3,3,3,4,1,1,1,2,3,4,5,6,6,-1,-23,-44,-512,1,2,3,4,4,4,4,4,4]
for i in xvalues:
print([i])
I need to substract previous value from current value while in for loop. I've tried
for i in xvalues:
print([i-1])
this but it is substract "-1" from every value in my list. I need to add this in a for loop simply;
[1]-[0] after this, do this ,[2]-[1] after ,do this [3]-[2]...
I'm looking for someone to help me and I hope this topic save someone :)