input: def exponential_series(x: float, n: int) -> float:
      """
      Calculate the sum of an exponential series for a given value x and n terms.
  
      >>> exponential_series(2, 4)
      31.0
      >>> exponential_series(3, 5)
      364.0
      """
output:     result = 0.0
      for i in range(n):
          result += x ** i
      return result