<prompt> Create an AI application that can play tic-tac-toe.  <response>: Sure, I can help you create an AI application that can play Tic-Tac-Toe. Heres a sample code in Python that you can use as a starting point:pythonimport randomboard for i in range9def print_board: row1 .formatboard0, board1, board2 row2 .formatboard3, board4, board5 row3 .formatboard6, board7, board8 print printrow1 printrow2 printrow3 printdef check_winnerchar, pos1,pos2,post3: return boardpos1 char and boardpos2 char and boardpos3 chardef check_allchar: Check rows for i in range3: if check_winnerchar, i3, i31, i32: return True Check columns for i in range3: if check_winnerchar, i, i3, i6: return True Check diagonals return check_winnerchar, 0, 4, 8 or check_winnerchar, 2, 4, 6def player_moveicon: if icon X: number 1 else: number 2 choice intinputPlayer , enter your move 1-9: .formatnumber.strip if boardchoice - 1 : boardchoice - 1 icon else: print printThat space is taken! player_moveicondef comp_move: possible_moves x for x in rangelenboard if boardx move -1 Check if computer can win for icon in O, X: for i in possible_moves: board_copy board: board_copyi icon if check_allicon: move i return move Try to take one of the corners corners 0,2,6,8 