Created
June 9, 2012 08:07
-
-
Save terapyon/2900071 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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