input: Write a function to calculate the sum of the series \( 1 + \frac{1}{2} + \frac{1}{3} + \ldots + \frac{1}{n} \). If n is 0, return 0. Otherwise, return the calculated sum.
  
  def seriesSum(n):
      if n == 0:
          return 0
      total = 0
      for i in range(1, n+1):
          total += 1 / i
      return total
  
  assert seriesSum(0) == 0
  assert seriesSum(1) == 1
  assert seriesSum(2) == 1.5
  assert seriesSum(3) == 1.8333333333333333
  assert seriesSum(5) == 2.283333333333333
output: def seriesSum(n):
      if n == 0:
          return 0
      total = 0
      for i in range(1, n+1):
          total += 1 / i
      return total