mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 15:16:33 -08:00
BUG: Hangman (Python) had a List-vs-Str comparison
MAINT: Add type annotations to find such issues
This commit is contained in:
@@ -15,9 +15,9 @@ def print_with_tab(space_count: int, msg: str) -> None:
|
||||
print(spaces + msg)
|
||||
|
||||
|
||||
def is_yes_ish(answer):
|
||||
def is_yes_ish(answer: str) -> bool:
|
||||
cleaned = answer.strip().upper()
|
||||
if cleaned == "Y" or cleaned == "YES":
|
||||
if cleaned in ["Y", "YES"]:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user