<prompt> Kujenga programu ambayo inaweza kucheza tic-tac-toe dhidi ya mchezaji binadamu.  <response>: Here is a Tic-Tac-Toe program in Python that allows a human player to play against an AI:pythonimport randomdef print_boardboard: for row in board: print .joinrowdef make_moveboard, player, x, y: if boardxy ! : return False boardxy player return Truedef 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 ! : return board02 No winner return Nonedef make_ai_moveboard, ai_player: Check if AI can win for x in range3: for y in range3: if boardxy : boardxy ai_player if has_winnerboard ai_player: return boardxy Check if player can win and block player X if ai_player O else O for x in range3: for y in range3: if boardxy : boardxy player if has_winnerboard player: boardxy ai_player return boardxy Make a random move available_moves x, y for x in range3 for y in range3 if boardxy x, y random 