input: Write a function to calculate the sum of an array of integers. If the array is empty, the function should return 0. The function should iterate through the array and accumulate the sum of its elements.
  assert calculate_sum([1, 3, 5, 7])==16
  assert calculate_sum([2, 4, 6, 8, 10])==30
  assert calculate_sum([-1, 0, 1])==0
  assert calculate_sum([])==0
output: def calculate_sum(arr):
      total = 0
      for num in arr:
          total += num
      return total