code: def partition(pred, iterable):
      'Use a predicate to partition entries into false entries and true entries'
      # partition(is_odd, range(10)) --> 0 2 4 6 8   and  1 3 5 7 9
      t1, t2 = itertools.tee(iterable)
      return list(filter(negate(pred), t1)), list(filter(pred, t2)f partition(pred, iterable):
      'Use a predicate to partition entries into false entries and true entries'
      # partition(is_odd, range(10)) --> 0 2 4 6 8   and  1 3 5 7 9
      t1, t2 = itertools.tee(iterable)
      return list(filter(negate(pred), t1)), list(filter(pred, t2))
docs: Use a predicate to partition entries into false entries and true entries