Learn to code / python

Python Intermediate

Step up from the fundamentals — comprehensions, error handling, file I/O, classes, decorators, generators, testing, and two real-world capstones. Assumes you've finished Python Fundamentals.

14 lessons·345 guided minutes·Real checks, not completion clicks
01

Comprehensions

Build lists, dicts, and sets in one line — the Pythonic shorthand for transforming collections.

~20 min →
02

Lambdas & Higher-Order Functions

Pass functions as arguments. Use lambda, map, filter, and sorted's key= to transform collections without writing a named function for every step.

~20 min →
03

Error Handling

Catch exceptions with try/except, raise your own, and clean up with finally — turn cryptic crashes into clear messages.

~25 min →
04

File I/O

Read and write text files with the with statement — Python's idiomatic way to make sure files always close, even when something goes wrong.

~25 min →
05

Modules & Imports

Split your code across multiple files. Import functions from a helper module and learn what __name__ == '__main__' actually does.

~20 min →
06

Classes & Objects

Bundle data and behavior together with classes — define your own types and give them methods that act on their own state.

~25 min →
07

Inheritance & super()

Build a class on top of another class — extend behavior, override methods, and call back to the parent with super().

~25 min →
08

Dunder Methods

Make your classes feel native — define __repr__, __eq__, __len__, and friends so Python's built-in operators just work.

~20 min →
09

Iterators & Generators

Produce values lazily with yield — write infinite sequences, stream large files, and stop computing the moment you've seen enough.

~25 min →
10

Decorators

Wrap a function with another function — log, time, cache, or check inputs without changing the function itself.

~25 min →
11

Testing Basics

Write tests with assert. Catch regressions before they reach production. Learn the three-line test that pays for itself a hundred times over.

~25 min →
12

Regex Basics

Match patterns in text with re — find, extract, and replace using a small set of metacharacters that cover most real-world cases.

~25 min →
13

Capstone: CSV Sales Analyzer

Read a CSV file, parse it into typed records, and report aggregates — combining file I/O, comprehensions, dicts, sets, lambdas, and string parsing into one small program.

~30 min →
14

Capstone: Mini In-Memory ORM

Build a tiny query layer over a list of records. Combines classes, dunders, lambdas, and chainable methods into one little library that feels like a real ORM.

~35 min →