Conteúdo do Curso
Beginner Final Project: Hangman
Beginner Final Project: Hangman
Is the Word Guessed?
The program needs to know when to stop asking the user for letters if the word is guessed. To do that we implement the is_word_guessed
function, which will say 'Ok, the user has guessed the gameword
. We may stop the program and congratulate the player!'
Tarefa
- Set the
is_word_guessed
function using thegameword
and theletters_already_guessed
as arguments. - Set condition to check if the
letters_already_guessed
is equal to thegameword
. ! - Return
True
if the condition is satisfied andFalse
otherwise. - Test the function using the
test_gameword
andtest_letters_already_guessed
lists. !Pay attention!
while implementing2. ...
task we need to useset(gameword) & set(letters_already_guessed)
structure to equal it to thegameword
. We do that because we need only letters fromletters_already_guessed
that are in thegameword.
&
- returns letters that are present in both words.
Tarefa
- Set the
is_word_guessed
function using thegameword
and theletters_already_guessed
as arguments. - Set condition to check if the
letters_already_guessed
is equal to thegameword
. ! - Return
True
if the condition is satisfied andFalse
otherwise. - Test the function using the
test_gameword
andtest_letters_already_guessed
lists. !Pay attention!
while implementing2. ...
task we need to useset(gameword) & set(letters_already_guessed)
structure to equal it to thegameword
. We do that because we need only letters fromletters_already_guessed
that are in thegameword.
&
- returns letters that are present in both words.
Tudo estava claro?
Is the Word Guessed?
The program needs to know when to stop asking the user for letters if the word is guessed. To do that we implement the is_word_guessed
function, which will say 'Ok, the user has guessed the gameword
. We may stop the program and congratulate the player!'
Tarefa
- Set the
is_word_guessed
function using thegameword
and theletters_already_guessed
as arguments. - Set condition to check if the
letters_already_guessed
is equal to thegameword
. ! - Return
True
if the condition is satisfied andFalse
otherwise. - Test the function using the
test_gameword
andtest_letters_already_guessed
lists. !Pay attention!
while implementing2. ...
task we need to useset(gameword) & set(letters_already_guessed)
structure to equal it to thegameword
. We do that because we need only letters fromletters_already_guessed
that are in thegameword.
&
- returns letters that are present in both words.
Tarefa
- Set the
is_word_guessed
function using thegameword
and theletters_already_guessed
as arguments. - Set condition to check if the
letters_already_guessed
is equal to thegameword
. ! - Return
True
if the condition is satisfied andFalse
otherwise. - Test the function using the
test_gameword
andtest_letters_already_guessed
lists. !Pay attention!
while implementing2. ...
task we need to useset(gameword) & set(letters_already_guessed)
structure to equal it to thegameword
. We do that because we need only letters fromletters_already_guessed
that are in thegameword.
&
- returns letters that are present in both words.
Tudo estava claro?
Is the Word Guessed?
The program needs to know when to stop asking the user for letters if the word is guessed. To do that we implement the is_word_guessed
function, which will say 'Ok, the user has guessed the gameword
. We may stop the program and congratulate the player!'
Tarefa
- Set the
is_word_guessed
function using thegameword
and theletters_already_guessed
as arguments. - Set condition to check if the
letters_already_guessed
is equal to thegameword
. ! - Return
True
if the condition is satisfied andFalse
otherwise. - Test the function using the
test_gameword
andtest_letters_already_guessed
lists. !Pay attention!
while implementing2. ...
task we need to useset(gameword) & set(letters_already_guessed)
structure to equal it to thegameword
. We do that because we need only letters fromletters_already_guessed
that are in thegameword.
&
- returns letters that are present in both words.
Tarefa
- Set the
is_word_guessed
function using thegameword
and theletters_already_guessed
as arguments. - Set condition to check if the
letters_already_guessed
is equal to thegameword
. ! - Return
True
if the condition is satisfied andFalse
otherwise. - Test the function using the
test_gameword
andtest_letters_already_guessed
lists. !Pay attention!
while implementing2. ...
task we need to useset(gameword) & set(letters_already_guessed)
structure to equal it to thegameword
. We do that because we need only letters fromletters_already_guessed
that are in thegameword.
&
- returns letters that are present in both words.
Tudo estava claro?
The program needs to know when to stop asking the user for letters if the word is guessed. To do that we implement the is_word_guessed
function, which will say 'Ok, the user has guessed the gameword
. We may stop the program and congratulate the player!'
Tarefa
- Set the
is_word_guessed
function using thegameword
and theletters_already_guessed
as arguments. - Set condition to check if the
letters_already_guessed
is equal to thegameword
. ! - Return
True
if the condition is satisfied andFalse
otherwise. - Test the function using the
test_gameword
andtest_letters_already_guessed
lists. !Pay attention!
while implementing2. ...
task we need to useset(gameword) & set(letters_already_guessed)
structure to equal it to thegameword
. We do that because we need only letters fromletters_already_guessed
that are in thegameword.
&
- returns letters that are present in both words.