input: from typing import List
  
  def exponential_series(x: float, n: int) -> float:
      """ Calculate the sum of the first n terms in the exponential series for a given x.
      >>> exponential_series(1, 5)
      6
      >>> exponential_series(2, 3)
      15
      """
      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