input: Write a python function to flatten a nested list.
  assert flat_list([1, [2, 3], [4, 5, 6], 7]) == [1, 2, 3, 4, 5, 6, 7]
  assert flat_list([[1, 2, 3], [4, 5], [6], 7]) == [1, 2, 3, 4, 5, 6, 7]
  assert flat_list([1, 2, [3, 4, [5, 6]], 7, 8]) == [1, 2, 3, 4, 5, 6, 7, 8]
output: def flat_list(nested_list):
      flat = []
      for item in nested_list:
          if isinstance(item, list):
              flat.extend(flat_list(item))
          else:
              flat.append(item)
      return flat