Teach yourself how to program by making computer games!
"Invent Your Own Computer Games with Python" is a free book that teaches you how to program in the Python programming language. Each chapter gives you the complete source code for a new game, and then teaches the programming concepts from the example.
"Invent with Python" was written to be understandable by kids as young as 10 to 12 years old, although it is great for anyone of any age who has never programmed before.
This second edition has revised and expanded content, including using the Pygame library to make games with graphics, animation, and sound.
Quick Download Links
- Download the Python 3.1 installer (for Windows)
- Download Python for other operating systems (Mac, Linux)
- Download the complete book as a PDF
(or view the web page version) - You can also download the source code of the games.
Compare Prices
I want to make programming knowledge accessible to everyone. As such, "Invent Your Own Computer Games with Python" is free to download and copy online under a Creative Commons license. And I've priced the print version (available for sale on Amazon.com) for $25.00 (including free shipping) to make it affordable. Compare this with other programming books on Amazon:
Python is the new BASIC
I learned how to program with a book similar to this one when I was 9 years old. That book covered games programming in the BASIC language. Python is a much more modern language that makes programming even easier. At the same time, Python is a serious language that is used by companies and organizations such as Google, NASA, Industrial Light and Magic, and many others.
Unfortunately, BASIC is not nearly as widespread as it once was, so it's hard to find materials for kids to teach themselves programming. There are many software "game creation kits" that are simple to use, but do not teach real programming languages and are limited to making only a few specific types of games. "Invent with Python" is designed to teach real programming in Python. Python has a very gentle learning curve (moreso than BASIC) and has a large online community that contributes to it.
"Invent with Python" is not a book for making professional video games (which require teams of artists and programmers), but rather a book to teach computer programming to non-programmers by making simple (but fun) games.
"I like that you make this book free. How can I help?"
If you like the book, please write a review on Amazon.
Vote for this site on Stumble Upon ![]()
"I'd like to distribute copies of Invent with Python."
"Invent Your Own Computer Games with Python" is released under a Creative Commons license that allows you to distribute copies (for noncommercial purposes.) See the by-nc-sa license text for full details. If you would like to commercially distribute this book, please contact the author at al@inventwithpython.com.
News and Updates
The book's blog contains news and updates about this book. You can subscribe to the RSS feed to be notified of these updates.
Contact
You can email the author at al@inventwithpython.com. Feel free to send your programming questions or comments.
Other programming guides for kids:
Here are some other free resources to learn programming (in Python and other languages):
- Hackety Hack (a programming tutorial in Ruby)
- How to Think Like a Computer Scientist: Learning with Python
- Snake Wrangling for Kids: Learning to Program with Python
- Python.org Official Documentation
- Hands-On Python: A Tutorial Introduction for Beginners
- The Guido van Robot Programming Language (a simplified form of Python, designed as a kid's tutorial)
- Greenfoot (programming in the Java language)
Copyright © 2008, 2009, 2010 by Albert Sweigart
"Invent Your Own Computer Games with Python" 2nd Edition is free to copy and distribute under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

