📜  python连续数字之间的差异 - Python代码示例

📅  最后修改于: 2022-03-11 14:46:29.495000             🧑  作者: Mango

代码示例1
[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]