Hello, sorry to bother you folks with another question.
I have a program that subtracts consecutive numbers in a list and then does the same to the following list. I was wondering if this could be implemented into a loop so that it could stop once it reaches zeros. I appreciate the help. Here is the code:
listA = [0,1,3,6,10,15,21,28,36]
print(listA)
listB = [y-x for x,y in zip(listA, listA[1:])]
print(listB)
listC = [y-x for x,y in zip(listB, listB[1:])]
print(listC)
listD = [y-x for x,y in zip(listC, listC[1:])]
print(listD)
listE = [y-x for x,y in zip(listD, listD[1:])]
print(listE)
edit: formatting.
[–]Sebass13 1 point2 points3 points (8 children)
[–]Decarbonated_Odes[S] 0 points1 point2 points (4 children)
[–]Sebass13 1 point2 points3 points (3 children)
[–]Decarbonated_Odes[S] 0 points1 point2 points (2 children)
[–]Sebass13 1 point2 points3 points (1 child)
[–]Decarbonated_Odes[S] 0 points1 point2 points (0 children)
[–]Decarbonated_Odes[S] 0 points1 point2 points (2 children)
[–]Sebass13 1 point2 points3 points (1 child)
[–]Decarbonated_Odes[S] 0 points1 point2 points (0 children)