Simple text-based implementation
$ python3 Tic-Tac-Toe.py
0 | 1 | 2 | |
--------- -----------
3 | 4 | 5 | |
--------- -----------
6 | 7 | 8 | |
You are "x", Select a spot(0~9): 1
0 | 1 | 2 o | x |
--------- -----------
3 | 4 | 5 | |
--------- -----------
6 | 7 | 8 | |
You are "x", Select a spot(0~9): 4
0 | 1 | 2 o | x |
--------- -----------
3 | 4 | 5 | x |
--------- -----------
6 | 7 | 8 | | o
You are "x", Select a spot(0~9): 7
0 | 1 | 2 o | x |
--------- -----------
3 | 4 | 5 | x | o
--------- -----------
6 | 7 | 8 | x | o
You Win!
$ python3 Tic-Tac-Toe.py
0 | 1 | 2 | |
--------- -----------
3 | 4 | 5 | |
--------- -----------
6 | 7 | 8 | |
You are "x", Select a spot(0~9): 2
0 | 1 | 2 | | x
--------- -----------
3 | 4 | 5 | o |
--------- -----------
6 | 7 | 8 | |
You are "x", Select a spot(0~9): 5
0 | 1 | 2 | o | x
--------- -----------
3 | 4 | 5 | o | x
--------- -----------
6 | 7 | 8 | |
You are "x", Select a spot(0~9): 0
0 | 1 | 2 x | o | x
--------- -----------
3 | 4 | 5 | o | x
--------- -----------
6 | 7 | 8 o | |
You are "x", Select a spot(0~9): 3
0 | 1 | 2 x | o | x
--------- -----------
3 | 4 | 5 x | o | x
--------- -----------
6 | 7 | 8 o | o |
You Lose!
$ python3 Tic-Tac-Toe.py
0 | 1 | 2 | |
--------- -----------
3 | 4 | 5 | |
--------- -----------
6 | 7 | 8 | |
You are "x", Select a spot(0~9): 1
0 | 1 | 2 | x |
--------- -----------
3 | 4 | 5 | |
--------- -----------
6 | 7 | 8 | o |
You are "x", Select a spot(0~9): 8
0 | 1 | 2 | x |
--------- -----------
3 | 4 | 5 | | o
--------- -----------
6 | 7 | 8 | o | x
You are "x", Select a spot(0~9): 2
0 | 1 | 2 | x | x
--------- -----------
3 | 4 | 5 | | o
--------- -----------
6 | 7 | 8 o | o | x
You are "x", Select a spot(0~9): 3
0 | 1 | 2 o | x | x
--------- -----------
3 | 4 | 5 x | | o
--------- -----------
6 | 7 | 8 o | o | x
You are "x", Select a spot(0~9): 4
0 | 1 | 2 o | x | x
--------- -----------
3 | 4 | 5 x | x | o
--------- -----------
6 | 7 | 8 o | o | x
No one wins!