mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-07 02:24: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:
@@ -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'.")
|
||||
|
||||
Reference in New Issue
Block a user