Leitner

Learn Python by watching your code run

Most people learning to program can read a loop and still not predict what it does. The fix is not another explanation of loops — it is seeing the variables change, one line at a time, until the model in your head matches the one in the machine. That is what the block below does, and it is the same code your lessons run on.

A Python loop, traced line by line, with the variables changing beside it.

Trace · a Python loopRUNNING
1total = 0
2for n in [3, 1, 4, 1, 5]:
3 if n > total:
4 total = n
5print(total)
total0
n
Outputwaiting…

Start with nothing in the box.

Step 1 of 15
Start a Python planThe first lesson of every plan is free

What people come here to do

You describe the goal in your own words and it asks questions back until the plan is one you would actually follow. These are the shapes that goal usually takes.

  • Write scripts that automate something at work
  • Get through a data course that assumes Python I never learnt
  • Move from copying snippets to reading a stack trace
  • Prepare for a technical interview

What a Python plan covers

Not a fixed syllabus — the plan is built around your goal and cuts what does not serve it. These are the topics it draws from, and whatever you get wrong comes back until it stops coming back.

Variables, types and how Python actually stores them
Loops, conditionals and control flow
Functions, scope and arguments
Lists, dicts, sets and when each is the right one
Reading errors and debugging your own code
Files, APIs and working with real data

Other subjects

The mechanics are the same whatever the subject — a slider is a slider whether it is moving a coefficient or a rate of return. What changes is what it is a slider for.

Or see how it works and what it costs.