Skip to content

Instantly share code, notes, and snippets.

@mebusw
Last active August 19, 2016 13:50
Show Gist options
  • Save mebusw/21c0bf0ceb580acc293f to your computer and use it in GitHub Desktop.
Save mebusw/21c0bf0ceb580acc293f to your computer and use it in GitHub Desktop.
generate sequence with char array, like column names of MS Excel does.
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