Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python difference between consecutive element in list

a = [0, 1, 2, 3]
[x - a[i - 1] for i, x in enumerate(a)][1:]
 
PREVIOUS NEXT
Tagged: #python #difference #consecutive #element #list
ADD COMMENT
Topic
Name
5+4 =