How do I make this work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I make this work?

import string import random import time possibleCharacters = string.ascii_lowercase + string.digits + string.ascii_uppercase + " .,!?;:" target = input("Enter your target text: ") attemptThis = ''.join(random.choice(possibleCharacters) for i in range(len(target))) attemptNext = '' completed = False generation = 0 while completed == False: print(attemptThis) attemptNext = '' completed = True for i in range(len(target)): if attemptThis[i] != target[i]: com

14th Dec 2016, 2:38 AM
Dania Miller
Dania Miller - avatar
2 Answers
0
What are you trying to do?
21st Dec 2016, 12:15 AM
Alex Mulligan
0
@AJ Mully The program takes your input and then randomly changes the letters of a beginning string of gibberish until it evolves into what the user imputed. Btw I'm sorry you didn't get that, I usually make a comment above ever line of code that says what it does but I forgot to this time.
21st Dec 2016, 1:00 AM
Dania Miller
Dania Miller - avatar