mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-12 15:50:20 -08:00
BUG: Hangman (Python) had a List-vs-Str comparison
MAINT: Add type annotations to find such issues
This commit is contained in:
@@ -16,23 +16,17 @@ def print_centered(msg: str) -> None:
|
||||
|
||||
def print_header(title: str) -> None:
|
||||
print_centered(title)
|
||||
print_centered("CREATIVE COMPUTING MORRISTOWN, NEW JERSEY")
|
||||
print()
|
||||
print()
|
||||
print()
|
||||
print_centered("CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n")
|
||||
|
||||
|
||||
def print_introduction() -> None:
|
||||
print("I, YOUR FRIENDLY MICROCOMPUTER, WILL DETERMINE")
|
||||
print("THE CORRECT CHANGE FOR ITEMS COSTING UP TO $100.")
|
||||
print()
|
||||
print()
|
||||
print("THE CORRECT CHANGE FOR ITEMS COSTING UP TO $100.\n\n")
|
||||
|
||||
|
||||
def pennies_to_dollar_string(p):
|
||||
def pennies_to_dollar_string(p: float) -> str:
|
||||
d = p / 100
|
||||
ds = f"${d:0.2f}"
|
||||
return ds
|
||||
return f"${d:0.2f}"
|
||||
|
||||
|
||||
def compute_change() -> None:
|
||||
@@ -95,9 +89,7 @@ def compute_change() -> None:
|
||||
|
||||
|
||||
def print_thanks() -> None:
|
||||
print("THANK YOU, COME AGAIN.")
|
||||
print()
|
||||
print()
|
||||
print("THANK YOU, COME AGAIN.\n\n")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
||||
Reference in New Issue
Block a user