4
def __init__(self, word,lives):
9
def playGame(word,lives):
10
hm = HangMan(word, lives)
12
while hm.livesLeft()>0 and hm.guessed() != 'successfully guessed':
13
letter = input('Guess a letter: ')
14
if letter.isupper() == True:
16
elif letter.isupper() == False :
17
print('Uppercase Only!!!')
22
if hm.guessed() == 'Not Sucessful':
23
print('You have no lives left - you have been hung!\n The word was', word)
24
else: print('Well done - you have guessed the word correctly!!!')
27
words = ("animal", "chickens", "hen", "home")
30
#store random words as rand
31
rand = random.choice(words)
33
print('Select an option\n 1. Easy\n 2. Intermediate\n 3. Hard')
35
level = int(input('Select level: '))