mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
Python: Fix Flake8 E722 and E741
Additionally: * Use functions to group blocks of code * Use variable names (not just one character...)
This commit is contained in:
@@ -61,7 +61,7 @@ def get_fort_choice():
|
||||
# try to convert the player's string input into an integer
|
||||
try:
|
||||
result = int(player_choice) # string to integer
|
||||
except:
|
||||
except Exception:
|
||||
# Whatever the player typed, it could not be interpreted as a number
|
||||
pass
|
||||
|
||||
@@ -124,7 +124,7 @@ def get_furs_purchase():
|
||||
try:
|
||||
count = int(count_str)
|
||||
results.append(count)
|
||||
except:
|
||||
except Exception:
|
||||
# invalid input, prompt again by re-looping
|
||||
i -= 1
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user