A guided technical learning path

Structure and Interpretation of Computer Programs (Python)

Classic CS curriculum adapted for Python, based on UC Berkeley CS61A

9 modules · about 10 hoursFreeHands-on labs

Your Learning Path

Each module builds on the last. Open any published lesson or lab and continue at your own pace.

1

Higher-Order Functions — Pass a function, return a function, and count the calls

Turn three near-identical sums into one function that takes its rule as an argument, then build fixed-point search, average damping and Newton’s method from functions that take and return functions.

You build: A general fold, compose and repeated (SICP 1.32, 1.42, 1.43)

  • functions as arguments
  • lambda
  • closures
  • fixed points
Free80 minReading materialInteractive lab
2

Environment Diagrams — SICP’s environment model in Python: frames, parents, and local state

Trace the frames a call creates, find the binding a name refers to, see why a function resolves free names where it was defined, and explain how make_withdraw keeps private state.

You build: define, assign and call frames in a small frame model

  • frames
  • lexical scope
  • nonlocal
  • local state
Free70 minReading materialInteractive lab
3

Recursive Functions — Linear and tree recursion, the processes they generate, and how to avoid repeated work

Factorial as a recursive and an iterative process, Fibonacci and counting change as tree recursion, orders of growth, exponentiation by squaring and Euclid’s algorithm.

You build: Traced recursive processes and a memoized route counter

  • recursion
  • iteration
  • tree recursion
  • memoization
Free110 minReading materialInteractive lab
4

Data Abstraction — Rational numbers, geometry and procedural pairs behind tested interfaces

Follow SICP’s rational-number, point and segment, procedural-pair and interval examples in Python. Specify constructor-selector laws, keep clients independent of storage, count where normalization work happens, and see why interval formulas that are algebraically equal give different bounds.

You build: A signed rational constructor, two rectangle representations and a pair made of functions (SICP 2.1, 2.3, 2.4)

  • constructors and selectors
  • abstraction barriers
  • procedural pairs
  • interval arithmetic
Free80 minReading materialInteractive lab
5

Sequences — Lists, conventional sequence stages and Python generators

Represent ordered sequences, map and filter while preserving order, distinguish fold direction, and trace how generators respond to demand. Measure actual source reads and stop a preview at its requested boundary.

You build: same-parity (SICP 2.20), Horner evaluation (2.34) and a traced lazy pipeline

  • map and filter
  • folds
  • sequence pipelines
  • generators
Free85 minReading materialInteractive lab
6

Trees — Follow structure, specify answers, map and search, and count traversal work

Separate labels from structure; count leaves and map over trees as SICP does; justify aggregation, transformation and first-match search; measure node visits and reuse completed answers.

You build: height, deep_reverse (SICP 2.27) and a first-match path search

  • trees
  • structural recursion
  • tree map
  • search
Free95 minReading materialInteractive lab
7

Mutable Data — Local state, shared identity and mutable links

Build stateful closures, trace aliases and link updates, count pairs by identity instead of by path, and give several passwords access to one shared balance.

You build: An accumulator, a destructive append, a password account and an identity-based pair counter (SICP 3.1–3.3, 3.12, 3.17)

  • local state
  • identity and sharing
  • mutable pairs
  • aliasing
Free95 minReading materialInteractive lab
8

Object-Oriented Programming — Objects as an alternative abstraction boundary

Organize state and behavior into classes. Connect OOP back to closures and message passing, then explore inheritance, method resolution, and how polymorphism enables multiple data representations.

FreeReading materialInteractive lab
9

Interpreters — Rebuilding the evaluator to understand computation itself

The capstone: build a working interpreter in ~100 lines of Python. Understand parsing, the Eval/Apply cycle, environments inside the interpreter, and how a language can describe itself.

FreeReading materialInteractive lab

Who this course helps

  • Learners who meet the course prerequisites
  • Independent developers building practical depth
  • Teams creating a shared technical vocabulary

A practical body of work from Structure and Interpretation of Computer Programs (Python)

  • Use higher-order functions, closures, and lambda expressions to write expressive, reusable code
  • Trace program execution using the environment model (frames, scoping, name lookup)
  • Think recursively and analyze recursive vs iterative processes

Move from explanation to worked examples and practice in one coherent learning path.

About This Course

This course is not about learning Python syntax. It is about learning how programs work.

Through classic SICP ideas adapted to Python, you will learn to reason about computation, abstraction, state, and interpreters—the foundations behind all modern software systems. Originally developed at MIT by Harold Abelson and Gerald Jay Sussman, SICP teaches the fundamental ideas of computation: abstraction, recursion, interpreters, and the nature of programming languages themselves.

This course adapts the core SICP curriculum into Python, following the approach pioneered by UC Berkeley's CS 61A. Instead of Scheme, all examples and exercises use Python—but the deep ideas remain the same.

The course progresses from simple abstractions (functions) through compound data, state and mutation, object-oriented design, and finally to building your own interpreter. The modules are being rebuilt one at a time as a written lesson followed by a lab that runs in your browser and draws what your code does. Modules 1 to 7 are in the new form; the others keep the book’s text and the earlier lab until they are rebuilt.

Based on Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman (MIT Press, 1996), adapted to Python following UC Berkeley CS 61A.

Prerequisites

  • Basic Python fluency (variables, if/else, loops, defining functions)
  • Comfort with simple math (algebra-level)
  • No prior CS theory or functional programming experience required

What You Will Learn

  • Use higher-order functions, closures, and lambda expressions to write expressive, reusable code
  • Trace program execution using the environment model (frames, scoping, name lookup)
  • Think recursively and analyze recursive vs iterative processes
  • Design programs using data abstraction and abstraction barriers
  • Process sequences and trees with map, filter, reduce, and recursive traversal
  • Reason about mutation, aliasing, and identity in Python
  • Use classes, inheritance, and polymorphism effectively
  • Build a working interpreter for a small programming language

Terminology Mapping

How classic concepts map to the terminology used in this course.

ClassicThis Course (Python)
Procedure / Higher-order procedureFunction / Higher-order function
Lambda expressionLambda expression (same concept)
Environment model of evaluationEnvironment diagrams (frames & scope)
Recursive / iterative processRecursive / iterative process (no tail-call optimization in Python)
Pairs (cons, car, cdr)Tuples, lists, or closure-based pairs
Data abstraction (constructors + selectors)Data abstraction (same pattern, using functions or classes)
Sequences (lists)Python lists, generators, comprehensions
Message passingDispatch functions / methods
Generic operations / data-directed programmingPolymorphism / duck typing
Metacircular evaluatorInterpreter written in Python

Module 1: Higher-Order Functions

Pass a function, return a function, and count the calls. About 80 minutes.

Start module 1 — free
Course interest

Help shape what we build next

Tell us what you want to learn. This records your interest; it does not enroll you or promise a launch email.

We use your address to identify duplicate responses and your note to decide what to build next.