spacepaste

  1.  
  2. from itertools import groupby
  3. from operator import itemgetter
  4. inputs = ((x > 5, x) for x in range(10))
  5. (_, a), (_, b) = groupby(inputs, key=itemgetter(0))
  6. print(list(a))
  7. print(list(b))
  8.