(n, epsilon=0.001)
return guess
Return square root of n, with maximum absolute error epsilon
Return square root of n, with maximum absolute error epsilon
Return square root of n with maximum absolute error epsilon
def square_root(n, epsilon=0.001):
    """Return square root of n, with maximum absolute error epsilon"""
    guess = n / 2

    while abs(guess * guess - n) > epsilon:
        guess = (guess + (n / guess)) / 2

    return guess
def square_root ( n , epsilon = 0.001 ) : guess = n / 2 while abs ( guess * guess - n ) > epsilon : guess = ( guess + ( n / guess ) ) / 2 return guess