Making a list by summing values

I had same question than you and I resolved it just now with another approach without python code or that scan node which impossible to convert to designscript code.

the solution you found @Paul_Aubin it is shorter script with few nodes, unfortunately Dynamo do not allow to convert to designscript code with the List.Scan node

same result other solutions with designscript code and list and math nodes:

To achieve want you wanted, just sum the span distance to this result, but first item of the list as 0.
image