Skip to content

Instantly share code, notes, and snippets.

@richardbwest
Last active July 22, 2016 15:11
Show Gist options
  • Save richardbwest/28cb2c7292d01428e90340e922acb21c to your computer and use it in GitHub Desktop.
Save richardbwest/28cb2c7292d01428e90340e922acb21c to your computer and use it in GitHub Desktop.
def getALetter():
global lives
global usedLetters
letter = input("please enter a letter")
if not len(letter) == 1: #Have they entered only 1 character?
mainScreen()
elif not letter.isalpha(): #Is that character a letter?
mainScreen()
elif in usedLetters: # Have they already guessed that letter?
mainScreen()
else:
usedLetters.append(letter) #if not, add it to the list of used letters
if not letter in chosenWord: #Have the guessed correctly?
lives = lives - 1 # If not, lose a life!
mainScreen()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment