input: Write a function to calculate the sum of the elements in a given list. The function should take a list as input and return the sum of all its elements. If the list is empty, the function should return 0.
  
  def sum_list(lst):
      total = 0
      for num in lst:
          total += num
      return total
  
  assert sum_list([1, 2, 3, 4, 5]) == 15
  assert sum_list([5, 10, 15, 20]) == 50
  assert sum_list([-1, -2, -3, -4, -5]) == -15
  assert sum_list([]) == 0
output: def sum_list(lst):
      total = 0
      for num in lst:
          total += num
      return total