Skip to content

Instantly share code, notes, and snippets.

@terapyon
Created June 9, 2012 08:07
Show Gist options
  • Save terapyon/2900071 to your computer and use it in GitHub Desktop.
Save terapyon/2900071 to your computer and use it in GitHub Desktop.
>>> import random
>>> def heya(li):
... random.shuffle(li)
... while li:
... yield li.pop(), li.pop()
...
>>> li = ['shoma', 'takanory', 'ike', 'tim', 'shimizukawa', 'jbking']
>>> list(heya(li))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment