input: Write a function to identify and correct any bugs in the provided Python code.
  assert sum_list([1, 2, 3])==6
  assert sum_list([-1, -2, -3])==-6
  assert sum_list([])==0
  assert sum_list([10])==10
  assert sum_list([5, 5, 5, 5])==20
output: def sum_list(lst):
      total = 0
      for num in lst:
          total += num
      return total