input: Write a function to create an AI Tic-Tac-Toe game using Python. The function should print the game board, check for winning conditions, and allow the player to play against the computer. The computer will make its moves randomly if it cannot win the game in the current move.
  
  assert playGame() == None
  assert drawBoard(['-', 'X', 'O', 'X', 'O', 'X', 'O', 'X', 'O', 'X']) == None
  assert checkWin(['-', 'X', 'X', 'X', '-', 'O', '-', 'O', '-', 'O'], 'X') == True
  assert checkWin(['-', 'X', 'O', 'X', 'O', 'X', 'O', 'X', 'O', 'X'], 'O') == False
  assert getComputerSpot(['-', 'X', 'O', 'X', '-', 'O', '-', 'O', '-', 'O'], 'O') in [1, 2, 3, 4, 5, 6, 7, 8, 9]
  assert getComputerSpot(['-', 'X', 'O', 'X', 'O', 'X', 'O', 'X', 'O', 'X'], 'O') == None
output: def playGame():
      board = ['-'] * 9
      player = 'X'
      computer = 'O'
      while True:
          drawBoard(board)
          if checkWin(board, player):
              print("Player wins!")
              break
          if checkWin(board, computer):
              print("Computer wins!")
              break
          if '-' not in board:
              print("It's a tie!")
              break
          if player == 'X':
              spot = int(input("Enter a spot (1-9): ")) - 1
              if board[spot] == '-':
                  board[spot] = player
                  player, computer = computer, player
          else:
              spot = getComputerSpot(board, computer)
              if spot is not None:
                  board[spot] = computer
                  player, computer = computer, player
  
  def drawBoard(board):
      for i in range(0, 9, 3):
          print(board[i], board[i+1], board[i+2])
  
  def checkWin(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 getComputerSpot(board, computer):
      import random
      available_spots = [i for i in range(9) if board[i] == '-']
      if not available_spots:
          return None
      return random.choice(available_spots)