input: 
  def TicTacToe():
      """Create a TicTacToe game in Python. The game should initialize a 3x3 board with '_', alternate turns between 'x' and 'o', 
      display the board, and check for a winning condition after each move. A player wins if they manage to get three of their 
      marks in a row, column, or diagonal.
      Example:
      for t = TicTacToe(), t.board should be initialized to a 3x3 grid with '_'
      """
  
output:     board = [['_' for _ in range(3)] for _ in range(3)]
      current_player = 'x'
  
      def display_board():
          for row in board:
              print(' '.join(row))
          print()
  
      def check_winner():
          # Check rows
          for row in board:
              if row[0] == row[1] == row[2] != '_':
                  return row[0]
          # Check columns
          for col in range(3):
              if board[0][col] == board[1][col] == board[2][col] != '_':
                  return board[0][col]
          # Check diagonals
          if board[0][0] == board[1][1] == board[2][2] != '_':
              return board[0][0]
          if board[0][2] == board[1][1] == board[2][0] != '_':
              return board[0][2]
          return None
  
      def is_board_full():
          return all(cell != '_' for row in board for cell in row)
  
      def make_move(row, col):
          nonlocal current_player
          if board[row][col] == '_':
              board[row][col] = current_player
              winner = check_winner()
              if winner:
                  print(f"Player {winner} wins!")
                  return True
              elif is_board_full():
                  print("It's a draw!")
                  return True
              current_player = 'o' if current_player == 'x' else 'x'
          else:
              print("Invalid move, try again.")
          return False
  
      def play():
          display_board()
          while True:
              try:
                  row, col = map(int, input(f"Player {current_player}, enter your move (row col): ").split())
                  if make_move(row, col):
                      display_board()
                      break
                  display_board()
              except ValueError:
                  print("Invalid input, try again.")
  
      play()