sqrt_good_enough = lambda x, guess: abs(guess * guess - x) < 0.001 sqrt_improve = lambda x, guess: (guess + x / guess) / 2