code: def partition(pred, iterable):
      
      trues = []
      falses = []
      for item in iterable:
          if pred(item):
              trues.append(item)
          else:
              falses.append(item)
      return trues, falses
docs: split the results of an iterable based on a predicate