python difference between consecutive element in list

Solutions on MaxInterview for python difference between consecutive element in list by the best coders in the world

showing results for - "python difference between consecutive element in list"
Adrienne
27 Aug 2020
1a = [0, 1, 2, 3]
2[x - a[i - 1] for i, x in enumerate(a)][1:]