Skip to content

Instantly share code, notes, and snippets.

def init():
print("Welcome to tic tac toe!\nWe will start with choosing teams.")
one = input("Player 1, do you want to be O or X: ").upper()
one = one if one in ("O", "X") else "O"
two = "O" if one == "X" else "X"
board = [[" " for _ in range(3)] for _ in range(3)]
return one, two, board
def show(matrix, columns):
print(" 1 2 3 \n ---+---+---")