Created
February 26, 2024 22:22
-
-
Save gavintranquilino/978b12e91c397eced2ca0e0fa636e3e9 to your computer and use it in GitHub Desktop.
Generate an list of n letter permutations of string of characters and save to a txt file in Python
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
from itertools import product | |
alphabet = "abcdefghijklmnopqrstuvwxyz" | |
usernames = ["".join(i) for i in product(alphabet, repeat=6)] | |
with open("myusernameisthis.txt", "w") as f: | |
for username in usernames: | |
f.write(username + "\n") | |
print("I'm Done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment