Here is the code for a tic tac toe (morpion in french) created in Python. It's a little project did in a few hours in class.
This repository contains 4 files. tictactoe.py is all the code I used. In order to make things easier to read, I separated my code in three other files :
-> display.py : all the functions making the game look good -> rules.py : all the rules of the game. Contains some config parameters (ie the size of the grid you want to play with, default parameter is 3, since Tic Tac Toe game is often played on a 9 tiles grid). -> main.py : to start the game ;-)