input: def play_tic_tac_toe():
      """ A simple TicTacToe game where the player is prompted to input their moves, and the game
      checks if there is a winner after each move.
      >>> game = TicTacToe()
      >>> game.board = [['x', 'o', '_'],
                        ['o', 'x', '_'],
                        ['o', 'x', 'x']]
      >>> game.check_win()
      False
      >>> game.board = [['x', 'x', 'x'],
                        ['o', '_', 'o'],
                        ['o', 'x', 'o']]
      >>> game.check_win()
      True
      """
output:     
      class TicTacToe:
          def __init__(self):
              self.board = [['_' for _ in range(3)] for _ in range(3)]
              self.current_player = 'x'
  
          def print_board(self):
              for row in self.board:
                  print(" ".join(row))
              print()
  
          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 is_full(self):
              return all(cell != '_' for row in self.board for cell in row)
  
          def play(self):
              while True:
                  self.print_board()
                  row = int(input(f"Player {self.current_player}, enter row (0, 1, 2): "))
                  col = int(input(f"Player {self.current_player}, enter column (0, 1, 2): "))
                  if self.board[row][col] == '_':
                      self.board[row][col] = self.current_player
                      if self.check_win():
                          self.print_board()
                          print(f"Player {self.current_player} wins!")
                          break
                      elif self.is_full():
                          self.print_board()
                          print("It's a draw!")
                          break
                      self.current_player = 'o' if self.current_player == 'x' else 'x'
                  else:
                      print("Cell already taken, try again.")
  
      play_tic_tac_toe()
  