Skip to content

Instantly share code, notes, and snippets.

Last active Dec 5, 2015
What would you like to do?
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)
if output == target:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment