input: Write a python function to sort a list either in ascending or descending order based on a given flag.
  assert sort_list([4, 2, 7, 1, 9], False) == [1, 2, 4, 7, 9]
  assert sort_list([4, 2, 7, 1, 9], True) == [9, 7, 4, 2, 1]
  assert sort_list([10, 20, 5, 15], False) == [5, 10, 15, 20]
  assert sort_list([10, 20, 5, 15], True) == [20, 15, 10, 5]
output: def sort_list(lst, descending):
      return sorted(lst, reverse=descending)