input: 
  def TicTacToe():
      """ Create a TicTacToe game in Python. This class initializes the game board and
      allows players to take turns placing their marks on the board. The game checks
      for a win condition after each move. The board is displayed after each turn.
      Example:
      An instance of the TicTacToe class is created. The board is initialized as a 3x3 grid
      with empty cells represented by '_'. Each player takes turns placing their mark ('x' 
      or 'o') on the board. The game checks for a win condition after each move by a player.
      """
      
      def __init__(self):
          self.board = [['_' for _ in range(3)] for _ in range(3)]
          self.turn = 'x'
          
      def display(self):
          for row in self.board:
              print(' '.join(row))
  
      def check_win(self):
          board = self.board
          for row in self.board:
              if row.count(self.turn) == 3:
                  return True
          for col in range(3):
              if board[0][col] == board[1][col] and board[1][col] == board[2][col] and board[2][col] == self.turn:
                  return True
          if board[0][0] == board[1][1] and board[1][1] == board[2][2] and board[2][2] == self.turn:
              return True
          if board[0][2] == board[1][1] and board[1][1] == board[2][0] and board[2][0] == self.turn:
              return True
          return False
  
output:     def make_move(self, row, col):
          if self.board[row][col] == '_':
              self.board[row][col] = self.turn
              if self.check_win():
                  self.display()
                  print(f"Player {self.turn} wins!")
                  return True
              self.turn = 'o' if self.turn == 'x' else 'x'
              self.display()
          else:
              print("Invalid move, try again.")
          return False
  
      def play(self):
          while True:
              try:
                  row, col = map(int, input(f"Player {self.turn}, enter your move (row col): ").split())
                  if self.make_move(row, col):
                      break
              except ValueError:
                  print("Invalid input, please enter two integers separated by a space.")