Answers for "python consecutive numbers difference between"

0

python consecutive numbers difference between

[y-x for x, y in zip(A[:-1], A[1:])] 

>>> A = [1, 10, 100, 50, 40]
>>> [y-x for x, y in zip(A[:-1], A[1:])]
[9, 90, -50, -10]
Posted by: Guest on September-09-2020

Code answers related to "python consecutive numbers difference between"

Python Answers by Framework

Browse Popular Code Answers by Language