[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]