input: Write a function to correct the sum_list function by fixing any bugs present in the original implementation. The function should correctly calculate the sum of elements in a list and return it.
  assert sum_list([1, 2, 3, 4]) == 10
  assert sum_list([5, -2, 3]) == 6
  assert sum_list([]) == 0
  assert sum_list([10]) == 10
  assert sum_list([-1, -1]) == -2
output: def sum_list(lst):
      total = 0
      for num in lst:
          total += num
      return total