Function to calculate Euclidean distance
def find ( x , y , p ) : NEW_LINE INDENT mind = 0 NEW_LINE for i in range ( len ( p ) ) : NEW_LINE INDENT a = p [ i ] [ 0 ] NEW_LINE b = p [ i ] [ 1 ] NEW_LINE mind += sqrt ( ( x - a ) * ( x - a ) + ( y - b ) * ( y - b ) ) NEW_LINE DEDENT return mind NEW_LINE DEDENT