Faced a challenge and thought I would post the results, assuming it might be useful to the larger community.
Faced with variable subtractions, list lengths and initial values, I came up with the following. This could be used to calculate differences in geometry along a length.
If nothing else, it’s a good learning exercise as it involves Imperative code, a While Loop, and Design Script. Hopefully my comments in the code block make sense.