input: Write a function to calculate an exponential series such that the sum is calculated based on the given value of \( x \) and the number of terms \( n \). Return the total sum as the result. The given array is empty then return True.
  assert exponential_series(2, 3) == 15
  assert exponential_series(1, 5) == 6
  assert exponential_series(0, 4) == 1
  assert exponential_series(3, 2) == 13
  assert exponential_series(4, 1) == 5
output: def exponential_series(x, n):
      if n == 0:
          return True
      total_sum = 0
      for i in range(n):
          total_sum += x ** i
      return total_sum