HackerTube.live
Books / Programming

THE READING ROOM / BOOK GUIDE

Invent your Own Computer Games with Python

Al Sweigart

A beginner's Python book built around making small games, aimed at readers who want working programs early and are willing to type code, break it, and fix it.

About the book

Invent Your Own Computer Games with Python teaches programming by having readers build playable games instead of working through abstract exercises. Al Sweigart wrote it for people with no prior coding experience. The method is direct: explain a few language features, then put them to work in a small program you can run and change. The games are modest in scope, which keeps the code short enough to read line by line and understand as a whole.

Core Python arrives along the way: variables, loops, conditionals, functions, lists, strings, and input handling. Each concept comes attached to something visible on screen, so the reader sees why it matters before moving on. The focus stays on the mechanics of writing and running programs, not on polished graphics or large-scale software design.

Sweigart favors plain explanation and complete code listings over clever shortcuts. Programming here is a craft learned by doing, with the game as the reason to keep going.

How to read it

Read with a keyboard nearby. The book assumes you will type the programs yourself, run them, and alter them. Copying code without running it defeats the purpose, and the small errors you introduce and then fix are where much of the learning happens.

The pace is gentle and the examples are short, so the book suits steady sessions rather than long sittings. Expect some repetition as familiar ideas return in new programs. That repetition is deliberate reinforcement. Readers who already know another language can skim the early explanations and spend their time on the projects.

Who it suits

This book fits complete beginners, including younger readers with some patience, who want a first language and a reason to practice it. Teachers and parents looking for a structured introduction will find the project-based sequence easy to follow. Readers who learn best by seeing output and tinkering with working code will get the most from it.

Reading considerations

Some tooling and library references may feel old, and later Python versions can require small adjustments to run the examples. Check which edition you have and whether it matches your installed Python. Readers seeking modern graphics, web development, or advanced software design should look elsewhere. This is a foundation, not a survey.

Follow the HN conversation

36 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.

Search HN comments about this book ↗

Explore videos on the same subject ↗

Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.