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:
Martin Thoma
2022-04-02 07:32:09 +02:00
parent 354c1f9ab3
commit c500424956
47 changed files with 208 additions and 387 deletions

View File

@@ -181,7 +181,7 @@ def display(Game: TicTacToe) -> None:
print(line1, "\n\n")
def play() -> None:
def main() -> None:
Pick = input("Pick 'X' or 'O' ").strip().upper()
if Pick == "O":
Game = TicTacToe("O")
@@ -219,4 +219,4 @@ def play() -> None:
if __name__ == "__main__":
play()
main()

View File

@@ -191,7 +191,7 @@ def prompt_player(board):
return move
def play():
def main():
print(" " * 30 + "TIC-TAC-TOE")
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY")
print("\n\n")
@@ -247,4 +247,4 @@ def play():
if __name__ == "__main__":
play()
main()