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

registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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:]