mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Python: Add type annotations
This commit is contained in:
committed by
Alexander Wunschik
parent
b95a514e84
commit
83b3dc402c
@@ -28,18 +28,16 @@ def initial_message():
|
||||
print("Here is a Revolver.")
|
||||
|
||||
|
||||
def parse_input():
|
||||
correct_input = False
|
||||
while not correct_input:
|
||||
def parse_input() -> int:
|
||||
while True:
|
||||
try:
|
||||
i = int(input("? "))
|
||||
correct_input = True
|
||||
return i
|
||||
except ValueError:
|
||||
print("Number expected...")
|
||||
return i
|
||||
|
||||
|
||||
def main():
|
||||
def main() -> None:
|
||||
initial_message()
|
||||
while True:
|
||||
dead = False
|
||||
|
||||
Reference in New Issue
Block a user