Python: Add type annotations to all 'print' functions (#662)

* Add test to superstartrek and fixes several issues in superstartrek - I probably introduced them 🙈
* Mastermind type annotations
This commit is contained in:
Martin Thoma
2022-03-21 10:41:14 +01:00
committed by GitHub
parent c444da93c0
commit 1b1d50986b
50 changed files with 241 additions and 172 deletions

View File

@@ -28,7 +28,7 @@ MAX_NUM = 100
MAX_GUESSES = 7
def print_instructions():
def print_instructions() -> None:
"""Instructions on how to play"""
print("I am thinking of a whole number from 1 to %d" % MAX_NUM)
print("Try to guess my number. After you guess, I")
@@ -38,7 +38,7 @@ def print_instructions():
print("means really close! You get %d guesses." % MAX_GUESSES)
def print_stars(secret_number, guess):
def print_stars(secret_number, guess) -> None:
diff = abs(guess - secret_number)
stars = ""
for i in range(8):