input: 
  def TicTacToe():
      """ This function initiates and manages a game of TicTacToe in Python.
      It initializes the game board which is a 3x3 matrix, toggles turns
      between 'x' and 'o' players, and checks for a winning condition every turn.
      If a win is found, it announces the winner.
      
      >>> game = TicTacToe()
      >>> game.board
      [['_', '_', '_'], ['_', '_', '_'], ['_', '_', '_']]
      >>> game.turn
      'x'
      >>> game.check_win()
      False
      """
  
output:     
      class TicTacToe:
          def __init__(self):
              self.board = [['_' for _ in range(3)] for _ in range(3)]
              self.turn = 'x'
          
          def check_win(self):
              for row in self.board:
                  if row[0] == row[1] == row[2] != '_':
                      return True
              for col in range(3):
                  if self.board[0][col] == self.board[1][col] == self.board[2][col] != '_':
                      return True
              if self.board[0][0] == self.board[1][1] == self.board[2][2] != '_':
                  return True
              if self.board[0][2] == self.board[1][1] == self.board[2][0] != '_':
                  return True
              return False
          
          def play(self, row, col):
              if self.board[row][col] == '_':
                  self.board[row][col] = self.turn
                  if self.check_win():
                      print(f"Player {self.turn} wins!")
                  self.turn = 'o' if self.turn == 'x' else 'x'
              else:
                  print("Invalid move, try again.")
  