Contenu du cours
Crafting a Classic Hangman Game
Crafting a Classic Hangman Game
 Hints 1/2
Hints 1/2
Guessing the word from a large file can be challenging, so we provide users with the option to use a hint.
Adding Hint Functionality
To integrate hint functionality into our program, we'll proceed in two phases. The hints_match function determines whether the current state of the gameword—which includes correctly guessed letters and placeholders—corresponds exactly to any word in the file. The function will return True if there's a match and False otherwise.
Tâche
Swipe to start coding
- Define the hints_matchfunction withword_to_matchandword_from_listas parameters.
- Remove spaces from word_to_match.
- Compare the lengths of test_listandother_list.
- Return Falseif the lengths differ.
- Initialize a forloop to iterate throughtest_list.
- Increment the counter.
Solution
Mark tasks as Completed
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 6
AVAILABLE TO ULTIMATE ONLY