Skip to content

Instantly share code, notes, and snippets.

@thejevans
Last active September 17, 2018 02:15
Show Gist options
  • Save thejevans/af291ebfc7f6b2a669b244d9f79fba3a to your computer and use it in GitHub Desktop.
Save thejevans/af291ebfc7f6b2a669b244d9f79fba3a to your computer and use it in GitHub Desktop.
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