Course Content
Beginner Final Project: Hangman
Beginner Final Project: Hangman
Available Letters
To help user we show available letters after every guess. The letter has to be deleted from the available_list
if it has been used already. To do that, we create the get_available_letters
function.
Task
- Set the
get_available_letters
function usingletters_already_guessed
as an argument. - Set the variable-alphabet
available_list
usingstring.ascii_lowercase
to get an alphabet. - Set
for
loop to work with elements of theavailable_list
in the reverse order. - Set condition if a letter from the
available_list
are equal to theletters_already_guessed
. - Delete an element from the
available_list
if it was guessed. - Test the function using the
test_letters_already_guessed
list.
Thanks for your feedback!
Available Letters
To help user we show available letters after every guess. The letter has to be deleted from the available_list
if it has been used already. To do that, we create the get_available_letters
function.
Task
- Set the
get_available_letters
function usingletters_already_guessed
as an argument. - Set the variable-alphabet
available_list
usingstring.ascii_lowercase
to get an alphabet. - Set
for
loop to work with elements of theavailable_list
in the reverse order. - Set condition if a letter from the
available_list
are equal to theletters_already_guessed
. - Delete an element from the
available_list
if it was guessed. - Test the function using the
test_letters_already_guessed
list.
Thanks for your feedback!
Available Letters
To help user we show available letters after every guess. The letter has to be deleted from the available_list
if it has been used already. To do that, we create the get_available_letters
function.
Task
- Set the
get_available_letters
function usingletters_already_guessed
as an argument. - Set the variable-alphabet
available_list
usingstring.ascii_lowercase
to get an alphabet. - Set
for
loop to work with elements of theavailable_list
in the reverse order. - Set condition if a letter from the
available_list
are equal to theletters_already_guessed
. - Delete an element from the
available_list
if it was guessed. - Test the function using the
test_letters_already_guessed
list.
Thanks for your feedback!
To help user we show available letters after every guess. The letter has to be deleted from the available_list
if it has been used already. To do that, we create the get_available_letters
function.
Task
- Set the
get_available_letters
function usingletters_already_guessed
as an argument. - Set the variable-alphabet
available_list
usingstring.ascii_lowercase
to get an alphabet. - Set
for
loop to work with elements of theavailable_list
in the reverse order. - Set condition if a letter from the
available_list
are equal to theletters_already_guessed
. - Delete an element from the
available_list
if it was guessed. - Test the function using the
test_letters_already_guessed
list.