input: Write a function to fix and return the corrected version of the given Python code that attempts to sum all elements in a list. If there are any bugs in the provided code, they should be identified and fixed.
  def sum_list(list):
      sum_list = 0
      for num in list:
          sum_list += num
      return sum_list
  
  assert sum_list([1, 2, 3]) == 6
  assert sum_list([-1, 1]) == 0
  assert sum_list([10, -10]) == 0
  assert sum_list([]) == 0
  assert sum_list([-5, -3, 2]) == -6
output: def sum_list(lst):
      total = 0
      for num in lst:
          total += num
      return total