dist = sqrt( (x2 - x1)**2 + (y2 - y1)**2 )
As others have pointed out, you can also use the equivalent built-in math.hypot():
dist = math.hypot(x2 - x1, y2 - y1)
dist = sqrt( (x2 - x1)**2 + (y2 - y1)**2 )
As others have pointed out, you can also use the equivalent built-in math.hypot():
dist = math.hypot(x2 - x1, y2 - y1)