input: Write a function that takes a list of numbers as input and prints the result of calculating the sum of the list. The function should be named `sum_list` and should return the sum of the elements in the list. If the input list is empty, the function should return 0.
  
  assert sum_list([1, 2, 3, 4, 5]) == 15
  assert sum_list([-1, -2, -3, -4, -5]) == -15
  assert sum_list([10, 20, 30]) == 60
  assert sum_list([]) == 0
output: def sum_list(numbers):
      if not numbers:
          return 0
      return sum(numbers)