I have a list:
my_list = [A,B,G,X,F,D]
Each letter on the list is some point in space (x,y).
I have a function to calculate distance between 2 points:
dist = distance(A,B)
I need to calculate list of distances between neighbouring points on the list:
list_of_distances = [distance(A,B), distance(B,G), distance(G,X), distance(X,F), distance(F,D)]
The question is: How to do it iteratively in most pythonic way?