input: Write a function to identify and fix any bugs in the provided Python code. Provide the corrected code and include assert statements to test the function.
  
  def sum_list(lst):
      total_sum = 0
      for num in lst:
          total_sum += num
      return total_sum
  
  assert sum_list([1, 2, 3, 4, 5]) == 15
  assert sum_list([0, 0, 0, 0]) == 0
  assert sum_list([-1, -2, -3, -4, -5]) == -15
  assert sum_list([]) == 0
  assert sum_list([10]) == 10
output: def sum_list(lst):
      total_sum = 0
      for num in lst:
          total_sum += num
      return total_sum