<prompt> Kujenga algorithm kwa ajili ya kucheza tic tac toe katika Python.  <response>: Tic-tac-toe or also known as noughts and crosses is a simple game that can be played between two players. Each player marks their move on a 3x3 grid, with the goal to make a horizontal, vertical or diagonal row of their symbol. Below is an example algorithm for playing tic-tac-toe in Python:1. Initialization: initialize the board as a 3x3 grid, with all its cell empty, represented by spaces .pythonboard , , , , , , , , 2. Display the board: create a function to display the current state of the board.pythondef display_boardboard: for row in board: print .joinrow 3. Players move: create a function to make a move, the function should take the players symbol, and the position of the move as input, and update the board accordingly. The position of the move can be represented as a tuple of row and column.pythondef make_movesymbol, position, board: row, col position if boardrowcol : boardrowcol symbol return True else: return False 4. Check for win: create a function to check if a player has won the game. A player wins when they have their symbol in a row, column, or diagonal. pythondef has_winnerboard: check rows for row in board: if row0 row1 row2 and row0 ! : return row0 check columns for col in range3: if board0col board1col board2col and board0col ! : return board0col check diagonals if board00 board11 board22 and board00 ! : return board00 if board02 board11 board20 and board02 