mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
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:
@@ -1,4 +1,4 @@
|
||||
def print_lightning_bolt():
|
||||
def print_lightning_bolt() -> None:
|
||||
|
||||
print("*" * 36)
|
||||
n = 24
|
||||
@@ -17,7 +17,7 @@ def print_lightning_bolt():
|
||||
print("*" * 36)
|
||||
|
||||
|
||||
def print_solution(n):
|
||||
def print_solution(n: int) -> None:
|
||||
|
||||
print(f"\n{n} plus 3 gives {n + 3}. This Divided by 5 equals {(n + 3) / 5}")
|
||||
print(f"This times 8 gives {((n + 3) / 5) * 8}. If we divide 5 and add 5.")
|
||||
|
||||
Reference in New Issue
Block a user