input: def exponential_series(x: float, n: int) -> float:
      """ Calculate the sum of the exponential series from 0 to n.
      >>> exponential_series(2, 3)
      15
      >>> exponential_series(1, 5)
      6
      """
output:     result = 0
      for i in range(n + 1):
          result += x ** i
      return result