Programming in Python
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.
Units
Units run in order. Where one needs an earlier unit, it says so.
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
Starts the courseLeads toQuantities and text
No level 2 lessons in this unit
No level 3 lessons in this unit
Level 1 · estimatedQuantities 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
Builds onFirst programsLeads toDecisions
No level 2 lessons in this unit
No level 3 lessons in this unit
Level 1 · estimatedBuilds on 1 First programs
Lessons in Quantities and text, 5
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
Builds onQuantities and textLeads toRepeated workFunctions
No level 2 lessons in this unit
No level 3 lessons in this unit
Level 1 · estimatedBuilds on 2 Quantities and text
Lessons in Decisions, 5
Repeated work
Repeat a block of lines with for and while loops.Level 1 · Foundations5 lessons30 min10 practice questions
0 of 5 done
Builds onDecisionsLeads toLists and dictionaries
No level 2 lessons in this unit
No level 3 lessons in this unit
Level 1 · estimatedBuilds on 3 Decisions
Lessons in Repeated work, 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
Builds onRepeated workNextFunctions
No level 2 lessons in this unit
No level 3 lessons in this unit
Level 1 · estimatedBuilds on 4 Repeated work
Lessons in Lists and dictionaries, 5
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
Builds onDecisionsEnds the course
No level 2 lessons in this unit
No level 3 lessons in this unit
Level 1 · estimatedBuilds on 3 Decisions
Lessons in Functions, 5
Your marks are kept in this browser only. My study data
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. Pick a unit to see the lesson links to and from it.
- 1First programsOpen this unit's lessons
- 2Quantities and textOpen this unit's lessons
- 3DecisionsOpen this unit's lessons
- 4Repeated workOpen this unit's lessons
- 5Lists and dictionariesOpen this unit's lessons
- 6FunctionsOpen this unit's lessons
- Take with Computer Science FoundationsBoth 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.
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.