input: Write a function to calculate the total sum of all elements in a list. If the list is empty, return 0.
  
  def calculate_sum_of_list(arr):
      if not arr:
          return 0
      total_sum = 0
      for item in arr:
          total_sum += item
      return total_sum
  
  assert calculate_sum_of_list([1, 2, 3, 4]) == 10
  assert calculate_sum_of_list([]) == 0
  assert calculate_sum_of_list([0]) == 0
  assert calculate_sum_of_list([10, 20, 30]) == 60
output: def calculate_sum_of_list(arr):
      if not arr:
          return 0
      total_sum = 0
      for item in arr:
          total_sum += item
      return total_sum