Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created November 22, 2020 17:53
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 JeffersGlass/814a097b04b72c07d4441e848a4e040c to your computer and use it in GitHub Desktop.
Save JeffersGlass/814a097b04b72c07d4441e848a4e040c to your computer and use it in GitHub Desktop.
from itertools import permutations
filename = "perm.txt"
text = input("Please enter the text to be scrambled: ")
with open(filename, "w") as outfile:
for p in permutations(text, len(text)):
for char in p:
outfile.write(str(char))
outfile.write("\n")
with open(filename, "r") as infile:
for line in infile:
print(line, end="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment