Kursinhalt
Crafting a Classic Hangman Game
Crafting a Classic Hangman Game
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.
Aufgabe
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.
Lösung
Mark tasks as Completed
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 6
AVAILABLE TO ULTIMATE ONLY