input: Write a python function to calculate the square root of a number using the Babylonian method.
  assert abs(sqrt(25) - 5) < 0.000001
  assert abs(sqrt(16) - 4) < 0.000001
  assert abs(sqrt(100) - 10) < 0.000001
  assert abs(sqrt(1) - 1) < 0.000001
output: def sqrt(n):
      if n < 0:
          raise ValueError("Cannot compute square root of a negative number.")
      if n == 0:
          return 0
      x = n
      y = (x + n / x) / 2
      while abs(x - y) > 0.000001:
          x = y
          y = (x + n / x) / 2
      return x