Hangman

Code Speed : 1s

Play The Game

+---+


| |


|


|


|


=========


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!