input: Write a function to calculate the sum of the items in a given list. If the given list is empty then return 0.
  assert sum_list([1, 2, 3, 4])==10
  assert sum_list([-1, -2, -3, -4])==-10
  assert sum_list([])==0
output: def sum_list(lst):
      return sum(lst) if lst else 0