Hangman
Code Speed : 1s
Play The Game
+---+
| |
|
|
|
=========
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
See the Code
0: def check_guess(word, tries, guesses):
1: if tries > 0:
2: display = [l if l in guesses else "_" for l in word]
3: print(" ".join(display))
4: if "_" not in display:
5: print("You win!")
6: break
7: guess = input()
8: if guess in word:
9: guesses.append(guess)
10: else:
11: tries -= 1
12: if tries == 0:
13: print("Game Over")
14: print("The word was {word}")
Click the light bulb icon to learn what the line of code does!