mirror of
https://github.com/QualityInUse/lab0-maksktl.git
synced 2026-08-05 12:25:26 +03:00
Lab 0
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user