input: Write a function to find and fix any bugs in the given Python code for calculating the sum of a list of numbers. If the given list is empty then return 0.
  def sum_list(list):
      sum_list = 0
      for num in list:
          sum_list += num
      return sum_list
  
  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([])==0
output: def sum_list(list):
      sum_list = 0
      for num in list:
          sum_list += num
      return sum_list