Skip to content

Instantly share code, notes, and snippets.

@Jonarzz
Last active December 5, 2015 12:47
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 Jonarzz/5cac9c0e4a899d28a3a7 to your computer and use it in GitHub Desktop.
Save Jonarzz/5cac9c0e4a899d28a3a7 to your computer and use it in GitHub Desktop.
import string
import random
ALL_CHARS = string.ascii_letters + string.digits + string.punctuation
target = input('Enter your target text: ')
output_list = []
for _ in target:
output_list.append(' ')
while True:
random_str = ''.join(random.choice(ALL_CHARS) for _ in range(len(target)))
for i in range(len(target)):
if target[i] != output_list[i]:
output_list[i] = random_str[i]
output = ''.join(output_list)
print(output)
if output == target:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment