Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- from itertools import combinations, product
- alphabet = string.ascii_lowercase
- max_length = 5
- file_ = open("combos.txt","w")
- def combos(chars=alphabet, max_len=max_length):
- for length in xrange(5, max_length + 1):
- for combo in map(''.join, product(alphabet, repeat=length)):
- yield combo
- for combo in combos():
- file_.write(combo + '\n')
- file_.close
- print(combo)
Add Comment
Please, Sign In to add comment