Comming from this question Adding the last position of an array to the same array
I was curious if the mentioned loop can be done in a list comprehension?
array = [3,4,2,5,4,5,8,7,8,9]
value = 10
for i in range(1,10):
array[i] = array[i-1] + value
I thought maybe with the walrus operator.
My attempt gave me an error which lead to cannot-use-assignment-expressions-with-subscript
[array[count] := val if count == 0 else array[count] := array[count-1] + value for count,val in enumerate(array)]
Any ideas?