input: Write a function to calculate the total sum of all elements in the given list using a for loop. If the list is empty, return 0.
  def calculate_sum(data):
      total = 0
      for element in data:
          total = total + element
      return total
  
  assert calculate_sum([1, 9, 3, 5])==18
  assert calculate_sum([4, 2, 7])==13
  assert calculate_sum([])==0
  assert calculate_sum([-1, -2, -3])==-6
output: def calculate_sum(data):
      total = 0
      for element in data:
          total = total + element
      return total