(secret_word, guessed)
| 6 | |
| 7 | # Function to display the current state of the word with placeholders for unguessed letters |
| 8 | def display_word(secret_word, guessed): |
| 9 | for letter in secret_word: |
| 10 | if letter in guessed: |
| 11 | print(letter, end=" ") |
| 12 | else: |
| 13 | print("_", end=" ") |
| 14 | print() |
| 15 | |
| 16 | # Function to generate a random word from a file |
| 17 | def get_random_word_from_file(filename): |