mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
Python: Add type annotations
This commit is contained in:
committed by
Alexander Wunschik
parent
b95a514e84
commit
83b3dc402c
@@ -79,7 +79,7 @@ def get_valid_guess(guesses: int) -> str:
|
||||
return guess
|
||||
|
||||
|
||||
def build_result_string(num: List[str], guess: str):
|
||||
def build_result_string(num: List[str], guess: str) -> str:
|
||||
result = ""
|
||||
|
||||
# Correct digits in wrong place
|
||||
@@ -105,10 +105,7 @@ def build_result_string(num: List[str], guess: str):
|
||||
return result
|
||||
|
||||
|
||||
######################################################################
|
||||
|
||||
|
||||
def main():
|
||||
def main() -> None:
|
||||
# Intro text
|
||||
print("\n Bagels")
|
||||
print("Creative Computing Morristown, New Jersey")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from bagels import build_result_string
|
||||
|
||||
|
||||
def test_build_result_string():
|
||||
def test_build_result_string() -> None:
|
||||
build_result_string(["a", "b", "c"], "abc")
|
||||
|
||||
Reference in New Issue
Block a user