I have a list of numbers, say
data = [45,34,33,20,16,13,12,3]
I'd like to compute the difference between 2 and 2 items, (that is, for the above data I want to compute 45-34,33-20,16-13 and 12-3, what's the python way of doing that ?
Also, more generally, how should I apply a function to 2 and 2 of these elements, that is, I want to call myfunc(data[0],data[1]),myfunc(data[2],data[3])
and so on over the list.