Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Guessed Word | Crafting a Classic Hangman Game
Crafting a Classic Hangman Game
course content

Contenido del Curso

Crafting a Classic Hangman Game

test

Swipe to show menu

book
Guessed Word

Preventing Excessive Gameplay

The program must recognize when to cease prompting the user for letters once the word has been successfully guessed. To achieve this, we'll develop the is_word_guessed function. This function will effectively communicate:

Great, the player has guessed the word correctly! It's time to halt the program and congratulate the player.

Tarea
test

Swipe to show code editor

  1. Define the is_word_guessed function with gameword and letters_already_guessed as parameters.
  2. Implement a condition to verify whether letters_already_guessed matches gameword.
  3. Return True if the condition is met, and False otherwise.

Note

During the execution of the second step, employ the set(gameword) & set(letters_already_guessed) expression to compare it with the set(gameword). This approach ensures that only the letters from letters_already_guessed that are in gameword are considered. The & operator identifies letters common to both sets.

Mark tasks as Completed
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 3
AVAILABLE TO ULTIMATE ONLY
We're sorry to hear that something went wrong. What happened?
some-alt