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