Learn Python

Python, taught with a game on the screen.

Most Python lessons ask you to print things. Printing is fine, and you will do plenty of it here — but a loop that prints Wave 3 incoming is a loop you have to imagine. A loop that puts forty tiles on the screen is a loop you can point at.

So every lesson here does both. The idea first, in plain Python, where you can see exactly what happened. Then the same idea building something you can play.

The first two lessons are the plain half on its own — a variable and a typed-in answer are worth meeting before there is a window in the way. Nothing is imported, and nothing moves. From lesson 3 the games start.

You need nothing installed. Open the playground, type, press Run. If you would rather work on your own machine, Get started takes four commands.

What this is not. This is not the guide. The guide teaches the engine — sprites, collision, scenes — and assumes you already know what a variable and a function are. These pages teach Python itself, and use the engine to make it visible.


Coming next

Nine lessons in, you can read any game in the games section. The tutorials are the next step: whole games built from nothing, one step at a time, using only what is on these pages.

Teaching with this, or stuck on something? There is a Discord.