input: Write a function to calculate the sum of an exponential series for a given base \( x \) and a specified number of terms \( n \). The function should return the sum of the series, which is \( \sum_{i=0}^{n} x^i \).
  
  
  assert exponential_series(2, 3) == 15
  assert exponential_series(3, 2) == 13
  assert exponential_series(1, 5) == 6
  assert exponential_series(0, 4) == 1
  assert exponential_series(10, 0) == 1
output: def exponential_series(x, n):
      return sum(x ** i for i in range(n + 1))