Skip to content

Instantly share code, notes, and snippets.

@VivienGiraud
Last active August 29, 2015 13:56
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 VivienGiraud/8999622 to your computer and use it in GitHub Desktop.
Save VivienGiraud/8999622 to your computer and use it in GitHub Desktop.
Create a table of every possibility you want.
#!/usr/bin/python
import itertools
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s'\
,'t','u','v','w','x','y','z']
maxStringLength = 3
file=open("data.txt",'w');
for x in range (1, maxStringLength + 1):
for i in itertools.product(alphabet,repeat=x):
file.write(''.join(i))
file.write('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment