input: Write a function to calculate the sum of squares of all numbers in an array of integers. The function should iterate through the array, square each element and sum the results. 
  
  def sum_squares(arr):
      total = 0
      for num in arr:
          total += num ** 2
      return total
  
  assert sum_squares([2, 3, 4])==29
  assert sum_squares([1, 2, 3, 4, 5])==55
  assert sum_squares([0, 0, 0])==0
  assert sum_squares([-1, -2, 3])==14
  assert sum_squares([])==0
output: def sum_squares(arr):
      total = 0
      for num in arr:
          total += num ** 2
      return total