input: 
  class TicTacToe:
      """ A simple TicTacToe game implementation.
  
      The game board is 3x3, with each position initially set to '_'. Players ('x' or 'o')
      take turns to place their marker on the board. The game checks for a win condition
      after each move, which can be a row, column, or diagonal filled with the same marker.
  
      Example:
      >>> game = TicTacToe()
      >>> game.display()
      _ _ _
      _ _ _
      _ _ _
      >>> game.turn
      'x'
      >>> game.board[0][0] = 'x'
      >>> game.board[1][1] = 'x'
      >>> game.board[2][2] = 'x'
      >>> game.check_win()
      True
      """
  
      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
  
          # check if the player with the current turn has a row of three
          for row in self.board:
              if row.count(self.turn) == 3:
                  return True
              
          # check if the player with the current turn has a column of three
          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
              
          # check for the two diagonals
          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 switch_turn(self):
          self.turn = 'o' if self.turn == 'x' else 'x'
  
      def make_move(self, row, col):
          if self.board[row][col] == '_':
              self.board[row][col] = self.turn
              if self.check_win():
                  return True
              self.switch_turn()
              return False
          else:
              return False