Tic-Tac-Toe written in Python!

 


Lately, I have been putting all my extra time into learning and getting better with Python. So far, it has been a relatively easy transition from VBA, C#, and JavaScript, but I still have much to learn. Using dictionaries, lists, loops, and if-elif-else statements I was able to code a functionally working command-line version of the classic Tic-Tac-Toe game.

You can play VS the computer and it has validation to verify correct user input. The computer is not that smart as it just uses the random.rand() function to find an empty space on the game board, but if you are not careful the computer might sneak in for a win.

Check it out with the link below. All the source code is available to see how it was made. I am sure there are probably some best practice ways to do things better but I am still getting familiar with the language. For now, I am just happy it is working and I will hopefully update the code soon.

Check it out here: Tic-Tac-Toe written in Python.

Enjoy! ;)