input: Write a function to calculate the sum of all the items in a given list and return the sum.
  def sum_list(input_list):
    sum = 0
    for i in input_list:
      sum += i
    return sum
  assert sum_list([1, 2, 3, 4])==10
  assert sum_list([5, 3, 8, 2])==18
  assert sum_list([0, 0, 0, 0])==0
  assert sum_list([-1, -2, -3, -4])==-10
  assert sum_list([10, -5, 7, -2])==10
output: def sum_list(input_list):
    sum = 0
    for i in input_list:
      sum += i
    return sum