If I have a list of values like this:
a=[5,4,3,2,1]
How would I then go about subtracting a value from the one before it and storing it in a new list? In this example, the new list would look like:
b=[1,1,1,1]
I'm assuming this could be done with a for loop, but I'm not sure how to index the values. The data I will be working with has hundreds of entries, so is there a way to reference a previous entry in a list?