backlinks to this page:
This tutorial should have give you an idea how to create array-based, 2-dimensional board games using python and even introduced you to the concept of AI players.
There exist of course countless other ways to write an TicTacToe game.
You may interested in following a tutorial to improve the graphical presentation of a game, like using a gui or a graphic library.
Because board games are relatively simple to understand, you may want to write a more complex AI or use even a neural network to create a challenging opponent.