input: Write a function to calculate an exponential series. The function should take two parameters: x (the base) and n (the number of terms in the series). The function should return the sum of the first n terms of the series where each term is x raised to the power of its position in the series (starting from 0).
  
  assert exponential_series(0, 5) == 1
  assert exponential_series(1, 5) == 6
  assert exponential_series(2, 3) == 15
output: def exponential_series(x, n):
      return sum(x ** i for i in range(n))