Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created August 29, 2019 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IISResetMe/56d7be5dcc433abb9975e63b8942817f to your computer and use it in GitHub Desktop.
Save IISResetMe/56d7be5dcc433abb9975e63b8942817f to your computer and use it in GitHub Desktop.
from itertools import product
def expand_alphabet(alphabet, max_width):
for width in range(1, max_width+1):
for combo in product(alphabet, repeat=width):
print(''.join(combo))
def main():
expand_alphabet(['a', 'b', 'c'], 4)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment