This commit is contained in:
e-maks
2024-02-12 23:34:49 +03:00
parent 8242d1cf50
commit 2a15056261
10 changed files with 323 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
from lab0maksktl.hangman import get_random_word
def test_hangman():
WORDS = ("python", "jumble", "easy", "difficult", "answer", "xylophone", "hangman",
"computer", "science", "programming", "mathematics", "player", "condition",
"reverse", "water", "board", "geeks", "keyboard", "laptop", "headphone",
"mouse", "printer", "scanner", "software", "hardware", "network", "server")
assert find_in_word_list(get_random_word(), WORDS)
def find_in_word_list(word, list_of_words) -> bool:
for list_part in list_of_words:
if word == list_part:
return True
return False