input: Write a function to calculate the total sum of all elements in the given list using a for loop in Python. The function should take a list as input and return the total sum of its elements. If the given list is empty, the function should return 0.
  
  def total_sum(data):
      total = 0
      for element in data:
          total = total + element
      return total
  
  assert total_sum([1, 9, 3, 5])==18
  assert total_sum([0, 0, 0, 0])==0
  assert total_sum([-1, 1])==0
  assert total_sum([])==0
  assert total_sum([10, -5, 3])==8
output: def total_sum(data):
      total = 0
      for element in data:
          total = total + element
      return total