Learning Python with Tic-Tac-Toe

(A free and fun class by Dr. Z)

Python is a very popular programming language that is widely used in many application fields from game creation to machine learning.

Tic Tac Toe is one of the most popular simple games almost all kids know how to play.

This one hour free class is designed to showcase how to learn basic Python programming concepts through creating a simple command line interactive Tic-Tac-Toe game in Python. Students will be able to see how Python code can be turned into a familiar game. The class will demonstrate how to use Python programming language to write game logics and create a two-user game.

## Check out the sample output of the code:

###################################################

$ python tic_tac_toe.py

Player X turn

– – –

– – –

– – –

Enter row and column numbers to fix spot: 1 1

Player O turn

X – –

– – –

– – –

Enter row and column numbers to fix spot: 2 1Player X turn

X – –

O – –

– – –

Enter row and column numbers to fix spot: 1 2

Player O turn

X X –

O – –

– – –

Enter row and column numbers to fix spot: 1 3

Player X turn

X X O

O – –

– – –

Enter row and column numbers to fix spot: 2 2

Player O turn

X X O

O X –

– – –

Enter row and column numbers to fix spot: 3 3

Player X turn

X X O

O X –

– – O

Enter row and column numbers to fix spot: 3 2

Player X wins the game!

X X O

O X –

– X O

###################################################