Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Get GameWord | Game Word
Beginner Final Project: Hangman
course content

Contenido del Curso

Beginner Final Project: Hangman

Beginner Final Project: Hangman

1. Game Word
2. Hints
3. Main Body

book
Get GameWord

After every guess, we need to allow the user to understand the state of his/her guesses. We need to allow to see the number of right letters guessed already and the remaining letters that are needed to be guessed. To do that we create the get_guessed_word function.

Scroll down to see the whole task code!

Tarea

Swipe to start coding

result_list is a list with the curent state of the gameword: right letters and gaps.

  1. Set the get_guessed_word function using the gameword and the letters_already_guessed as arguments.
  2. Set the for loop to work with the gameword using i as an iterator and range() function.
  3. Set condition to check if elements of the gameword are equal to the letters_already_guessed.
  4. Append the letter list(gameword)[i]) to the the result_list if condition is satisfied, append '_ '(with the space) otherwise.
  5. Test the function using the test_gameword and test_letters_already_guessed lists.

Solución

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 4
toggle bottom row

book
Get GameWord

After every guess, we need to allow the user to understand the state of his/her guesses. We need to allow to see the number of right letters guessed already and the remaining letters that are needed to be guessed. To do that we create the get_guessed_word function.

Scroll down to see the whole task code!

Tarea

Swipe to start coding

result_list is a list with the curent state of the gameword: right letters and gaps.

  1. Set the get_guessed_word function using the gameword and the letters_already_guessed as arguments.
  2. Set the for loop to work with the gameword using i as an iterator and range() function.
  3. Set condition to check if elements of the gameword are equal to the letters_already_guessed.
  4. Append the letter list(gameword)[i]) to the the result_list if condition is satisfied, append '_ '(with the space) otherwise.
  5. Test the function using the test_gameword and test_letters_already_guessed lists.

Solución

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 4
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Lamentamos que algo salió mal. ¿Qué pasó?
some-alt