input: Write a function to simulate a Tic-Tac-Toe game between a human and an AI using Python. The function should initialize the game board, alternate turns between the human and the AI, check for a win condition after each move, and draw the board after each turn. If the game is won by either the human or the AI, the function should print the winning player. If the game is drawn, the function should print "The game is drawn!" and terminate the game.
  assert playGame()==None
  assert playGame()==None
  assert playGame()==None
  assert playGame()==None
  assert playGame()==None
  assert playGame()==None
output: def playGame():
      board = [' ' for _ in range(9)]
      def print_board(board):
          print(f"{board[0]}|{board[1]}|{board[2]}")
          print("-+-+-")
          print(f"{board[3]}|{board[4]}|{board[5]}")
          print("-+-+-")
          print(f"{board[6]}|{board[7]}|{board[8]}")
  
      def check_win(board, player):
          win_conditions = [(0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8), (0, 4, 8), (2, 4, 6)]
          for condition in win_conditions:
              if board[condition[0]] == board[condition[1]] == board[condition[2]] == player:
                  return True
          return False
  
      def check_draw(board):
          return ' ' not in board
  
      def ai_move(board):
          import random
          available_moves = [i for i in range(9) if board[i] == ' ']
          return random.choice(available_moves)
  
      current_player = 'X'
      while True:
          print_board(board)
          if current_player == 'X':
              move = int(input("Enter your move (0-8): "))
              if board[move] != ' ':
                  print("Invalid move, try again.")
                  continue
          else:
              move = ai_move(board)
          board[move] = current_player
          if check_win(board, current_player):
              print_board(board)
              print(f"Player {current_player} wins!")
              break
          if check_draw(board):
              print_board(board)
              print("The game is drawn!")
              break
          current_player = 'O' if current_player == 'X' else 'X'