Python, Concept by Concept

Learn Python one idea at a time

Contents

13 units, 5 checkpoints, 1 project, in the order the course teaches them.

  1. Unit 1: Output & VariablesExercises (20): Output & VariablesSlides: Output & Variables
  2. Unit 2: Numbers & ArithmeticExercises (23): Numbers & ArithmeticSlides: Numbers & Arithmetic
  3. Unit 3: DecisionsExercises (21): DecisionsSlides: Decisions
  4. Checkpoint 1: Checkpoint 01: FoundationsQuestions (7): Checkpoint 01: Foundations
  5. Unit 4: Loops & CountingExercises (34): Loops & CountingSlides: Loops & Counting
  6. Unit 5: For & RangeExercises (31): For & RangeSlides: For & Range
  7. Checkpoint 2: Checkpoint 02: LoopsQuestions (7): Checkpoint 02: Loops
  8. Unit 6: Turtle GeometryExercises (18): Turtle GeometrySlides: Turtle Geometry
  9. Unit 7: FunctionsExercises (32): FunctionsSlides: Functions
  10. Unit 8: Randomness: Dice, Simulations, and a Wandering TurtleExercises (20): Randomness: Dice, Simulations, and a Wandering TurtleSlides: Randomness: Dice, Simulations, and a Wandering Turtle
  11. Checkpoint 3: Checkpoint 03: Functions & RandomnessQuestions (7): Checkpoint 03: Functions & Randomness
  12. Unit 9: StringsExercises (29): StringsSlides: Strings
  13. Unit 10: ListsExercises (37): ListsSlides: Lists
  14. Unit 11: DictionariesExercises (28): DictionariesSlides: Dictionaries
  15. Checkpoint 4: Checkpoint 04: Dictionaries & CollectionsQuestions (7): Checkpoint 04: Dictionaries & Collections
  16. Unit 12: FilesExercises (28): FilesSlides: Files
  17. Unit 13: ObjectsExercises (24): ObjectsSlides: Objects
  18. Checkpoint 5: Checkpoint 05: Files & ObjectsQuestions (7): Checkpoint 05: Files & Objects
  19. Project 1: Algorithm ChallengeProblems (11): Algorithm Challenge

Printable books (PDF)

Release pdfs-2026-09-30. The links open the files on GitHub.

For parents and teachers:

Use this book offline

Downloading a book needs JavaScript.

Everything stays on this device. Some browsers, Safari in particular, can clear a site's storage after weeks without a visit: keep a copy of your work with “Export my progress” on the home page.

Concept mastery

The share of each concept's quiz cards you know well (answered right twice, at least a day apart). Practise with the quiz cards.

All 40 concepts

IO

  • Printing output0%

Strings

  • String literals and quotes0%
  • f-string formatting0%
  • String concatenation and repetition0%
  • String slicing0%
  • String methods (case, strip/replace, split/join, find, is-tests)0%
  • Membership testing with in0%

Data

  • Floats and decimal arithmetic0%
  • Arithmetic operators (+ - * / // %)0%
  • Type conversion (int/str/float)0%
  • Boolean values0%

Control

  • Comparison operators0%
  • Logical operators (and/or/not)0%
  • if statements0%
  • elif and else branches0%

Loops

  • while loops0%
  • Loop control (break/continue)0%
  • for loops0%
  • The range function0%
  • Accumulator pattern0%
  • Nested loops0%

Modules

  • Importing modules0%
  • Random numbers (randint/choice)0%

Functions

  • Defining functions0%
  • Function parameters and arguments0%
  • Return values0%
  • Built-in functions (len/min/max)0%

Collections

  • Creating lists0%
  • List indexing (and .index)0%
  • Growing and changing lists (append/insert/pop/remove)0%
  • Sorting lists with the sort method0%
  • Creating dictionaries0%
  • Looping over dictionaries0%

Files

  • Reading files0%
  • Writing files0%
  • Opening files with with0%

OOP

  • Defining classes0%
  • __init__ and creating objects0%
  • Object attributes0%
  • Object methods0%