input: Write a function to identify and fix any bugs in the given Python code that intends to sum up a list of numbers. The corrected function should return the correct sum of the list elements.
  assert sum_list([1, 2, 3, 4]) == 10
  assert sum_list([-1, -2, -3, -4]) == -10
  assert sum_list([0, 0, 0, 0]) == 0
  assert sum_list([10, 20, 30, 40]) == 100
  assert sum_list([]) == 0
output: def sum_list(numbers):
      total = 0
      for num in numbers:
          total += num
      return total