Created
December 30, 2013 09:32
-
-
Save atondwal/8179820 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
def shuffle(first, second): | |
if first is "" and second is "" : yield "" | |
if first is not "": | |
for i in shuffle(first[:-1],second): yield (i+first[-1]) | |
if second is not "": | |
for i in shuffle(first,second[:-1]): yield (i+second[-1]) | |
[print(i) for i in shuffle("12","34")] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment