BUG: Hangman (Python) had a List-vs-Str comparison

MAINT: Add type annotations to find such issues
This commit is contained in:
Martin Thoma
2022-03-31 10:33:11 +02:00
parent b31c624703
commit ae0b6a5015
22 changed files with 347 additions and 365 deletions

View File

@@ -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: