given a list (0 2 5 8), what is an elegant way to add successive elements, producing a new list. For example, the new list would be:
0 (not changed)
0 + 2 = 2
2 + 5 = 7
7 + 8 = 15
The new list would be (0 2 7 15)
Thanks!
given a list (0 2 5 8), what is an elegant way to add successive elements, producing a new list. For example, the new list would be:
0 (not changed)
0 + 2 = 2
2 + 5 = 7
7 + 8 = 15
The new list would be (0 2 7 15)
Thanks!
Hi das,
the simplest way:
Best
K
Thank you so much K.