Learn Python

A track for people who have never programmed. Each page introduces one idea, lets you run small examples, and ends with short exercises you solve right on the page. Nothing to install.

Work through the pages in order. Each takes about half an hour.

The examples use a small shop throughout: items like apple and bread, prices, quantities, and a shopping list. The vocabulary stays the same so you can focus on the Python, not the story.

  1. Getting started: what programming is, values, names, and functions.
  2. Decisions and text: true and false, if, and strings.
  3. Collections and loops: lists, loops, dictionaries, tuples and sets.
  4. Stacks, queues and priority queues: three structures defined by the order things come out.
  5. Practice: 120 mixed problems to make all of it stick.