Quarry School

Programming in Python

Subject: Computing

Write and run short Python programs, trace how values change and use error messages to fix a line.

6 units, 30 lessons. Free, no sign-up.

  • Builds on no other course
  • Take with Computer Science Foundations Both courses work with numbers and text: the foundations course works out on paper how bits stand for them, and the Python course uses them in code.

Computing6 units30 lessonsLevel 1about 3 hours60 practice questionsFree

Before you start

Use Python 3.13 with IDLE to run the examples, or follow the traces on paper.

Read an example, predict what it prints and check your answer.

Ask the AI tutor by voice or text on supported lessons.

Start lesson 1

Unit 1, lesson 1

Run your first Python program

0 of 30 lessons done

Crash course: quick reviews

Units

Units run in order. Where one needs an earlier unit, it says so.

  1. First programs

    Write and run short Python programs, trace how values change and use error messages to fix a line.

    Level 1 · Foundations5 lessons28 min10 practice questions

    0 of 5 done

    No level 2 lessons in this unit

    No level 3 lessons in this unit

    Subject: ComputingLevel 1 · estimated
    Lessons in First programs, 5
    1. Run your first Python programLevel 1 · Foundations7 minSubject: Computing
    2. Tell text from numbersLevel 1 · Foundations5 minSubject: Computing
    3. Give a value a nameLevel 1 · Foundations7 minSubject: Computing
    4. Read a reply from the keyboardLevel 1 · Foundations4 minSubject: Computing
    5. Use an error message to fix a programLevel 1 · Foundations5 minSubject: Computing
  2. Quantities and text

    Calculate with numbers, select part of a string and format a line of output.

    Level 1 · Foundations5 lessons20 min10 practice questions

    0 of 5 done

    No level 2 lessons in this unit

    No level 3 lessons in this unit

    Subject: ComputingLevel 1 · estimated

    Builds on 1 First programs

    Lessons in Quantities and text, 5
    1. Choose an arithmetic operatorLevel 1 · Foundations4 minSubject: Computing
    2. Group a calculationLevel 1 · Foundations3 minSubject: Computing
    3. Keep a remainderLevel 1 · Foundations4 minSubject: Computing
    4. Index and slice a labelLevel 1 · Foundations5 minSubject: Computing
    5. Format a line of outputLevel 1 · Foundations4 minSubject: Computing
  3. Decisions

    Ask a true-or-false question about a value, run one block of lines or another, and test the values where a rule changes.

    Level 1 · Foundations5 lessons36 min10 practice questions

    0 of 5 done

    No level 2 lessons in this unit

    No level 3 lessons in this unit

    Subject: ComputingLevel 1 · estimated

    Builds on 2 Quantities and text

    Lessons in Decisions, 5
    1. Ask a true-or-false questionLevel 1 · Foundations7 minSubject: Computing
    2. Choose a branchLevel 1 · Foundations8 minSubject: Computing
    3. Handle a boundary valueLevel 1 · Foundations7 minSubject: Computing
    4. Combine two conditionsLevel 1 · Foundations7 minSubject: Computing
    5. Trace a ticket ruleLevel 1 · Foundations7 minSubject: Computing
  4. Repeated work

    Repeat a block of lines with for and while loops.

    Level 1 · Foundations5 lessons30 min10 practice questions

    0 of 5 done

    No level 2 lessons in this unit

    No level 3 lessons in this unit

    Subject: ComputingLevel 1 · estimated

    Builds on 3 Decisions

    Lessons in Repeated work, 5
    1. Read a for loopLevel 1 · Foundations6 minSubject: Computing
    2. Choose the bounds of rangeLevel 1 · Foundations6 minSubject: Computing
    3. Trace a while loopLevel 1 · Foundations6 minSubject: Computing
    4. Keep a running totalLevel 1 · Foundations6 minSubject: Computing
    5. Stop a search at a matchLevel 1 · Foundations6 minSubject: Computing
  5. Lists and dictionaries

    Keep many values under one name: a list in order, and a dictionary by key.

    Level 1 · Foundations5 lessons22 min10 practice questions

    0 of 5 done

    No level 2 lessons in this unit

    No level 3 lessons in this unit

    Subject: ComputingLevel 1 · estimated

    Builds on 4 Repeated work

    Lessons in Lists and dictionaries, 5
    1. Build an ordered listLevel 1 · Foundations5 minSubject: Computing
    2. Update an item by indexLevel 1 · Foundations5 minSubject: Computing
    3. Look up a keyLevel 1 · Foundations4 minSubject: Computing
    4. Count repeated labelsLevel 1 · Foundations4 minSubject: Computing
    5. Choose a list or dictionary for a rosterLevel 1 · Foundations4 minSubject: Computing
  6. Functions

    Give a block of lines a name, pass it values and get a result back.

    Level 1 · Foundations5 lessons30 min10 practice questions

    0 of 5 done

    No level 2 lessons in this unit

    No level 3 lessons in this unit

    Subject: ComputingLevel 1 · estimated

    Builds on 3 Decisions

    Lessons in Functions, 5
    1. Give a repeated task a nameLevel 1 · Foundations5 minSubject: Computing
    2. Pass an argumentLevel 1 · Foundations5 minSubject: Computing
    3. Return a resultLevel 1 · Foundations6 minSubject: Computing
    4. Trace a local nameLevel 1 · Foundations8 minSubject: Computing
    5. Compose two small functionsLevel 1 · Foundations6 minSubject: Computing

The course as a map

Open a unit to follow its lesson connections.

How the units connect

The bar beside a unit counts the lesson links later units make to it.

Where the course leans

This course has no lesson links between units. The map shows the units in course order.

Unit 2: Quantities and text builds on Unit 1: First programs.

Unit 3: Decisions builds on Unit 2: Quantities and text.

Unit 4: Repeated work builds on Unit 3: Decisions.

First programs
  1. Run your first Python program
  2. Tell text from numbers
  3. Give a value a name
  4. Read a reply from the keyboard
  5. Use an error message to fix a program
Quantities and text
  1. Choose an arithmetic operator

    Leans on: Unit: First programs

  2. Group a calculation
  3. Keep a remainder
  4. Index and slice a label
  5. Format a line of output
Decisions
  1. Ask a true-or-false question

    Leans on: Unit: Quantities and text

  2. Choose a branch
  3. Handle a boundary value
  4. Combine two conditions
  5. Trace a ticket rule
Repeated work
  1. Read a for loop

    Leans on: Unit: Decisions

  2. Choose the bounds of range
  3. Trace a while loop
  4. Keep a running total
  5. Stop a search at a match
Lists and dictionaries
  1. Build an ordered list

    Leans on: Unit: Repeated work

  2. Update an item by index
  3. Look up a key
  4. Count repeated labels
  5. Choose a list or dictionary for a roster
Functions
  1. Give a repeated task a name

    Leans on: Unit: Decisions

  2. Pass an argument
  3. Return a result
  4. Trace a local name
  5. Compose two small functions