mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-20 14:22:50 -08:00
Simplify Python Code
print_with_tab / print_with_whitespace is trivial with Python string formatting and was mostly used in only 2 lines.
This commit is contained in:
@@ -48,7 +48,7 @@ def main() -> None:
|
||||
|
||||
still_playing = True
|
||||
while still_playing:
|
||||
print("")
|
||||
print()
|
||||
n = int(input("How many rolls? "))
|
||||
|
||||
# Roll the dice n times
|
||||
@@ -64,7 +64,7 @@ def main() -> None:
|
||||
print(" %-14d%d" % (i, freq[i]))
|
||||
|
||||
# Keep playing?
|
||||
print("")
|
||||
print()
|
||||
response = input("Try again? ")
|
||||
if len(response) > 0 and response.upper()[0] == "Y":
|
||||
# Clear out the frequency list
|
||||
|
||||
Reference in New Issue
Block a user