input: 
  from typing import List
  
  
  def exponential_series(x: float, n: int) -> float:
      """Calculate the sum of an exponential series up to the nth term for a given x.
      For example, the function will calculate sum: x^0 + x^1 + x^2 + ... + x^n.
  
      >>> exponential_series(2, 5)
      63.0
      >>> exponential_series(3, 3)
      40.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