pts = [(10, 10), (10, 11), (20, 11), (20, 10), (10, 10)]
ptdiff = lambda p1_p2: (p1_p2[0][0] - p1_p2[1][0], p1_p2[0][1] - p1_p2[1][1])
diffs = map(ptdiff, zip(pts, pts[1:]))
path = sum(hypot(*d) for d in diffs)
Как найти расстояние между двумя точками?