CodeRigor

FREE COURSE / REAL PRACTICE

Functional Python foundations

Extend Python functions and iterators into reusable, deterministic data transformations.

Free lessons & exercises8 authored lessons3 units

What you’ll work toward

Design pure transformations, callback policies, closure snapshots, recursive text walks and bounded lazy pipelines, then build a reusable deterministic text-report tool.

Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.

Before you start

This course builds on these skills:

Individual lessons can add prerequisites. The course map shows your actual readiness.

A look inside the first lesson

Pure functions and effect boundaries

Python
def add_count(counts, word):
    updated = dict(counts)
    updated[word] = updated.get(word, 0) + 1
    return updated

before = {"oak": 2}
after = add_count(before, "oak")
print(before, after)
assert before == {"oak": 2}

Your course outline

Follow the lessons in curriculum order. Open a unit to preview the ideas you’ll work with.

UNIT 014 lessons Functions as reusable values
  1. LESSON 01.01

    Pure functions and effect boundaries

    Make state changes explicit as returned values, preserve caller inputs, and keep rendering separate from effects.

    Open lesson
  2. LESSON 01.02

    First-class functions and callback contracts

    Pass selection and transformation policies as values, and fold a sequence with an explicit initial state.

    Open lesson
  3. LESSON 01.03

    Closures, snapshots and late binding

    Create independent configured functions while making captured references and configuration snapshots explicit.

    Open lesson
  4. LESSON 01.04

    Composition, identity and branching

    Assemble unary stages in a documented order and branch one value into independently computed results.

    Open lesson
UNIT 023 lessons Transform data and streams
  1. LESSON 02.01

    Immutable transformations and alias boundaries

    Return independent nested values and distinguish input-preserving conventions from deeply immutable representations.

    Open lesson
  2. LESSON 02.02

    Recursive data transformations

    Decompose nested text trees with explicit leaf cases, structural progress, ordering and depth limits.

    Open lesson
  3. LESSON 02.03

    Lazy transformations and consumption budgets

    Compose pull-based selection and mapping while measuring exactly how much a one-shot input is consumed.

    Open lesson
UNIT 031 lesson Deterministic transformation capstone
  1. LESSON 03.01

    Capstone: reusable deterministic text reports

    Combine recursive token streams, captured configuration, pure callbacks and stable aggregation into a reusable reporting pipeline.

    Open lesson