The Tic-tac-toe game is played by two players X and O on 3x3 grid, where at each step the player X have to mark ’x’ on a free position he choose, then the turn of player O to mark ’o’ in a free position too, the game ends in a maximum of 5 stages. The winner is the player that marks a row first, it can be a vertical, horizontal or diagonal row, if there is no winner at the 5th stage, the two players are tied.
I made the python code for two people to play in textual mode, the photo shows an example of the different game stages.