input: Write a function to calculate an exponential series given an input value and the number of terms in the series. The function should return the sum of the series. 
  def exponential_series(x, n):
      sum = 0
      for i in range(n+1):
          sum += x ** i
      return sum
  
  assert exponential_series(2, 3) == 15
  assert exponential_series(3, 4) == 121
  assert exponential_series(1, 5) == 6
  assert exponential_series(4, 2) == 21
  assert exponential_series(0, 10) == 1
output: def exponential_series(x, n):
      sum = 0
      for i in range(n+1):
          sum += x ** i
      return sum