Python: Add type annotations

This commit is contained in:
Martin Thoma
2022-04-02 09:30:56 +02:00
parent 624c55711c
commit a561322962
15 changed files with 42 additions and 40 deletions

View File

@@ -15,7 +15,7 @@ Ported by Dave LeCompte
import time
def get_yes_or_no():
def get_yes_or_no() -> bool:
while True:
response = input().upper()
if response == "YES":
@@ -25,7 +25,7 @@ def get_yes_or_no():
print(f"EH? I DON'T UNDERSTAND '{response}' TRY 'YES' OR 'NO'.")
def play_game():
def play_game() -> None:
print("PLEASE THINK OF A NUMBER BETWEEN 1 AND 100.")
print("YOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF")
a = int(input())