input: Write a function to fix any bugs in the provided Python code that calculates the sum of elements in a list. If the given list is empty then return 0. The provided code should be corrected and validated with the following test cases.
  
  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, 0, 1]) == 0
  assert sum_list([]) == 0
  assert sum_list([10, 20, 30, 40]) == 100
  assert sum_list([-5, -3, 0, 3, 5]) == 0
output: def sum_list(lst):
      total = 0
      for num in lst:
          total += num
      return total