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

@@ -112,10 +112,10 @@ def print_intro() -> None:
def ask_bool(prompt: str) -> bool:
while True:
answer = input(prompt)
if answer == "YES":
answer = input(prompt).lower()
if answer == "yes":
return True
elif answer == "NO":
elif answer == "no":
return False
else:
print("INCORRECT ANSWER - - PLEASE TYPE 'YES' OR 'NO'.")