input: 
  def exponential_series(x: float, n: int) -> float:
      """Calculate the sum of the first n+1 terms of the exponential series for a given x.
      The exponential series is given by: Σ (x^i) for i = 0 to n.
      
      >>> exponential_series(2, 3)
      15.0
      >>> exponential_series(3, 4)
      121.0
      """
      sum = 0
      for i in range(n + 1):
          sum += x ** i
      return sum
  
output:     sum = 0
      for i in range(n + 1):
          sum += x ** i
      return sum