Skip to content

Instantly share code, notes, and snippets.

@Jonarzz Jonarzz/Evolution of text
Last active Dec 5, 2015

Embed
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)
print(output)
if output == target:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.