BUG: Hangman (Python) had a List-vs-Str comparison

MAINT: Add type annotations to find such issues
This commit is contained in:
Martin Thoma
2022-03-31 10:33:11 +02:00
parent b31c624703
commit ae0b6a5015
22 changed files with 347 additions and 365 deletions

View File

@@ -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