Answers for "consecutive elements diff"

0

consecutive elements diff

>>> t
[1, 3, 6]
>>> [j-i for i, j in zip(t[:-1], t[1:])]  # or use itertools.izip in py2k
[2, 3]
Posted by: Guest on April-17-2021

Code answers related to "consecutive elements diff"

Python Answers by Framework

Browse Popular Code Answers by Language