Contenuti del Corso
Crafting a Classic Hangman Game
Crafting a Classic Hangman Game
Hints 2/2
Revealing the Hint
The second phase of the hint mechanism is called show_possible_matches. This function displays the word from the file (word_from_list) if it corresponds to the current configuration of the gameword.
Compito
Swipe to start coding
- Define the
show_possible_matchesfunction withword_to_matchas a parameter. - Initialize a
forloop to iterate through the elements intest_word_list. - Append an element to the
possible_matcheslist ifhints_matchreturnsTrue. - Check if the
possible_matcheslist is empty and set a corresponding condition.
Soluzione
Mark tasks as Completed
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 7
AVAILABLE TO ULTIMATE ONLY