input: from typing import List
  
  
  def exponential_series(x: float, n: int) -> float:
      """Calculate the sum of the exponential series given x and n.
      The series is 1 + x + x^2 + x^3 + ... + x^n.
      >>> exponential_series(2, 4)
      31.0
      >>> exponential_series(3, 2)
      13.0
      """
output:     result = 0.0
      for i in range(n + 1):
          result += x ** i
      return result