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:
Martin Thoma
2022-03-12 08:17:03 +01:00
parent fc9ea8eaf9
commit af88007734
18 changed files with 846 additions and 764 deletions

View File

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