(p1, p2=None)
return distance
Find the distance between two (x, y) coordinates.
Find the distance between two (x, y) coordinates.
Find the distance between two ( x y ) coordinates .
def calculate_distance(p1, p2=None):
    """Find the distance between two (x, y) coordinates."""
    if p2 is None:
        return 0.0
    distance = ((p2[0] - p1[0]) ** 2 + (p2[1] - p1[1]) ** 2) ** 0.5
    return distance
def calculate_distance ( p1 , p2 = None ) : if p2 is None : return 0.0 distance = ( ( p2 [ 0 ] - p1 [ 0 ] ) ** 2 + ( p2 [ 1 ] - p1 [ 1 ] ) ** 2 ) ** 0.5 return distance