Last active
September 17, 2018 02:15
-
-
Save thejevans/af291ebfc7f6b2a669b244d9f79fba3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
letters_guessed = 'blah' | |
secret_word = 'hello' | |
output = '' | |
for a in secret_word: | |
if a in letters_guessed: | |
output += a | |
else: | |
output += '_' | |
alphabet = 'abcdefghijklmnopqrstuvwxyz' | |
available_answers = [x for x in alphabet if x not in letters_guessed] | |
answer = 'q' | |
if answer.lower() in available_answers: | |
letters_guessed += answer | |
else: | |
print('can\'t do that, son') | |
return str(available_answers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment