Teach yourself how to program by making computer games!
"Invent Your Own Computer Games with Python" is a free e-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.
IYOCGwP ("eye-yawk-gwip") was written to be understandable by 10 to 12 year olds, although it is great for anyone of any age who has never programmed before.
Quick Download Links
- Download the Python installer (for Windows)
- (download other versions)
- Download the book's PDF (or view the web page version)
- You can also download the source code or the executable versions of the games (the executables don't require Python to be installed.)
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. IYOCGwP 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.
Guiding Principles
- The book should teach real programming in a real programming language. Click-and-drag "game generators" or fake, dumbed-down kiddie programming languages are to be avoided.
- Games are fun. The book should not teach programming like a mathematics textbook.
- Concise is good.
- Show the complete source code up front, and teach from the examples. Don't drown people with abstract programming concepts or a reference manual.
- If it takes more than 200 words to explain an idea, there's probably a better way to explain it.
- The book is useless unless it makes them want to program.
- Pictures that explain concepts are helpful. Pictures for the sake of pictures are a distraction. (Save the pretty pictures for the cover.)
- Anyone should be able to point to any sentence and demand I give them the reason that that particular sentence has not been excluded from the book.
Start reading it now, on the web, for free!
- Chapter 1 - Introduction
- Chapter 2 - Hello world!
- Chapter 3 - Guess the Number
- Chapter 4 - Jokes
- Chapter 5 - Dragon World
- ...read the other chapters
Have something to say?
Leave a comment on the blog page for this book.
You can email the author at
or use the forum.
Other programming guides for kids:
Here are some other free resources to learn programming (in Python and other languages):
- Hackety Hack (programming in the Ruby language)
- How to Think Like a Computer Scientist: Learning with Python
- Snake Wrangling for Kids: Learning to Program with Python
- Python.org 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)
IYOCGwP is free to copy and distribute under a Creative Commons license.
Copyright 2008 © by Albert Sweigart
"Invent Your Own Computer Games with Python" is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.


