input: Write a function to implement an AI-based Tic-Tac-Toe game in Python. The function should take no input, and the output should be the game being played between a human player and the computer. The computer should choose spots randomly but prioritize winning moves. The game should display the board after each move, and announce the winner or a draw once the game is over. The function should be named `playGame`.
  
  assert playGame()
  assert playGame()
  assert playGame()
  assert playGame()
  assert playGame()
output: import random
  
  def playGame():
      def print_board(board):
          for row in board:
              print(" | ".join(row))
              print("-" * 5)
  
      def check_winner(board, player):
          for row in board:
              if all([cell == player for cell in row]):
                  return True
          for col in range(3):
              if all([board[row][col] == player for row in range(3)]):
                  return True
          if all([board[i][i] == player for i in range(3)]) or all([board[i][2 - i] == player for i in range(3)]):
              return True
          return False
  
      def is_full(board):
          return all([cell != " " for row in board for cell in row])
  
      def get_empty_spots(board):
          return [(i, j) for i in range(3) for j in range(3) if board[i][j] == " "]
  
      def computer_move(board):
          for player in ["O", "X"]:
              for spot in get_empty_spots(board):
                  board[spot[0]][spot[1]] = player
                  if check_winner(board, player):
                      return spot
                  board[spot[0]][spot[1]] = " "
          return random.choice(get_empty_spots(board))
  
      board = [[" " for _ in range(3)] for _ in range(3)]
      current_player = "X"
  
      while True:
          print_board(board)
          if current_player == "X":
              row, col = map(int, input("Enter row and column (0-2): ").split())
              if board[row][col] != " ":
                  print("Spot already taken. Try again.")
                  continue
          else:
              row, col = computer_move(board)
              print(f"Computer chose row {row}, column {col}")
  
          board[row][col] = current_player
  
          if check_winner(board, current_player):
              print_board(board)
              print(f"Player {current_player} wins!")
              break
  
          if is_full(board):
              print_board(board)
              print("It's a draw!")
              break
  
          current_player = "O" if current_player == "X" else "X"