Last active
August 19, 2016 13:50
-
-
Save mebusw/21c0bf0ceb580acc293f to your computer and use it in GitHub Desktop.
generate sequence with char array, like column names of MS Excel does.
This file contains 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 g(L): | |
for i in L: | |
yield i | |
for i in [ x+y for x in L for y in L]: | |
yield i | |
gg=g(['A', 'B', 'C']) | |
for i in xrange(15): | |
print next(gg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment