Skip to content
Pebellslearn by building

The course

Python

Learn core Python, then connect its object model, iterators, functions and resource handling to practical programs. Work through data processing, storage, packaging, testing and concurrency; combine them in Quarry, then explore the calculations behind a small machine-learning model.

Ready to learn

Your path through the ideas

Inside the course

18 modules · 91 lessons
CLI tools & setup · Start here

Install your tools, choose your setup and verify a local run.

02Fundamentals14 lessons

Python fundamentals are the basic rules for writing instructions, representing values and controlling what a program does. Learn to read and write small programs using names, calculations, decisions, repetition, functions and common collections.

  1. 01Basic Syntax & Output16 min
  2. 02Variables & Data Types17 min
  3. 03Operators & Math18 min
  4. 04Working with Strings18 min
  5. 05Conditionals21 min
  6. 06Loops20 min
  7. 07Type Casting & Input20 min
  8. 08Functions27 min
  9. 09Exceptions & Errors20 min
  10. 10Built-in Functions20 min
  11. 11Lists, Tuples & Sets22 min
  12. 12Dictionaries22 min
  13. 13Type Annotations20 min
  14. 14Capstone — Bill Splitter & Tip Calculator40 min
03Fundamentals Follow-up Projects4 lessons

A programming project combines several small concepts into a tool that solves one complete problem. Build a café checkout, a data analyzer, a budget tracker and a small game while learning to connect and test their parts.

  1. 01Project 1 — Terminal Café POS50 min
  2. 02Project 2 — CSV Data Analyzer50 min
  3. 03Project 3 — Expense & Budget Tracker50 min
  4. 04Project 4 — Text Adventure50 min
04Objects7 lessons

Object-oriented programming organizes a program around objects: values that combine their own state with operations on that state. Build objects with clear responsibilities, protect their rules and use shared interfaces to work with different implementations.

  1. 01What Is OOP?18 min
  2. 02Classes & Instances19 min
  3. 03Encapsulation20 min
  4. 04Inheritance20 min
  5. 05Polymorphism19 min
  6. 06Abstraction20 min
  7. 07Dunder Methods19 min
05The Object Model4 lessons

Python’s object model describes how values behave as objects and how names refer to them. Follow identity, shared references, mutation, hashing and lifetime to explain changes that ordinary variable names can hide.

  1. 01Names, Objects & Identity23 min
  2. 02Mutable, Immutable & Hashable25 min
  3. 03What Keeps an Object Alive27 min
  4. 04Capstone — The Inspector43 min
06Iteration & Laziness4 lessons

Iteration means taking values from a source one at a time. Laziness means postponing work until its result is requested. Learn how loops obtain values, how generators pause between values and how a pipeline can stop before processing its whole input.

  1. 01Writing an Iterable by Hand25 min
  2. 02Generators: Functions That Pause25 min
  3. 03Chaining Generators into a Pipeline27 min
  4. 04Capstone — The Feed43 min
07Functional Python5 lessons

Functional programming emphasizes composing functions and transforming values. Scope determines which binding a name refers to. Follow names and values through closures, mapping, filtering, comprehensions and lazy expressions, then decide where state should live.

  1. 01Variable Scope & the LEGB Rule21 min
  2. 02Lambdas, map, filter & reduce21 min
  3. 03List & Set Comprehensions19 min
  4. 04Generator Expressions19 min
  5. 05Programming Paradigms19 min
08Closures & Decorators6 lessons

A closure is a function that retains access to names from an enclosing function. A decorator transforms or wraps a callable to add behavior. Use remembered state and function composition to build wrappers for logging, retries, caching and request processing.

  1. 01Closures & the Cell25 min
  2. 02Decorators27 min
  3. 03Decorators That Take Arguments27 min
  4. 04functools27 min
  5. 05Callables, *args & Signatures25 min
  6. 06Capstone — The Middleware Ring43 min
09The Standard Toolbox5 lessons

Python’s standard library is the collection of modules supplied with Python for common programming tasks. Choose useful tools for counting, grouping, priority ordering, named states, numerical work and combining iterators.

  1. 01Collections: Counter, defaultdict, namedtuple, OrderedDict19 min
  2. 02deque and heapq19 min
  3. 03Enum17 min
  4. 04math and random18 min
  5. 05itertools19 min
10Data Structures in Practice6 lessons

Applied data structures are concrete ways to organize data so particular operations are easier or less costly. Compare arrays, links, hash maps, stacks, queues, heaps and trees by tracing the operations they support.

  1. 01Arrays & Linked Lists17 min
  2. 02HashMaps16 min
  3. 03Stacks, Queues & Heaps17 min
  4. 04Binary Search Trees18 min
  5. 05Recursion16 min
  6. 06Sorting Algorithms17 min
11Files, Paths & Encodings6 lessons

File handling moves data between a program and storage. An encoding specifies how text is represented as bytes. Work with paths, streams, cleanup and binary formats while keeping character counts, byte counts and file evidence distinct.

  1. 01pathlib25 min
  2. 02Reading & Writing, Text and Binary27 min
  3. 03Writing Your Own Context Manager29 min
  4. 04Unicode, str and bytes29 min
  5. 05Bytes, Buffers & struct29 min
  6. 06Capstone — The Yard45 min
12Serialisation & Storage5 lessons

Serialization converts values into a format that can be stored or transmitted. Storage keeps those representations for later use. Move records through CSV, JSON, trusted caches and SQLite while checking types, boundaries and round-trip behavior.

  1. 01CSV & the Dialects Nobody Agrees On27 min
  2. 02JSON, and the Types It Cannot Hold27 min
  3. 03Pickle, and Why You Must Not Load Untrusted Data27 min
  4. 04sqlite3 & the DB-API31 min
  5. 05Capstone — The Vault45 min
13Text & Patterns5 lessons

A text pattern describes a shape to find in a string. A regular expression is one language for writing such patterns. Find, capture and transform text, then separate a successful match from meaningful validation and safe execution.

  1. 01Regular Expressions29 min
  2. 02Groups, Named Captures & Lookaround29 min
  3. 03sub, split, finditer & Flags27 min
  4. 04Catastrophic Backtracking & When Not to Use Regex29 min
  5. 05Capstone — The Extractor45 min
14Modules, Environments & Packaging3 lessons

A module is a unit of importable Python code. Packaging describes how code, metadata and dependencies are distributed and installed. Organize a project, isolate its environment and connect an installed command to the function it should run.

  1. 01Modules, Packages & What import Really Does31 min
  2. 02Virtual Environments & Pinned Dependencies29 min
  3. 03pyproject.toml, Wheels & the Console Entry Point31 min
15Failure & Observability3 lessons

Failure handling decides how a program responds when an operation cannot finish. Logging records events that help explain what happened. Choose recovery boundaries, preserve original causes and collect useful evidence without hiding failures or duplicating messages.

  1. 01The Hierarchy, `raise from` & `finally`33 min
  2. 02Logging31 min
  3. 03Capstone — The Black Box45 min
16Testing & Debugging7 lessons

Testing compares observed behavior with an explicit expectation. Debugging investigates why the behavior differs from that expectation. Design useful checks, control test state and dependencies, and use observations to find the first incorrect assumption or value.

  1. 01Your First pytest Suite27 min
  2. 02Fixtures, Parametrisation & Scope29 min
  3. 03Doubles, patch & Test Seams31 min
  4. 04Properties, Coverage & Honest Green29 min
  5. 05pdb, Post-Mortem & Bisecting29 min
  6. 06unittest, doctest & tox25 min
  7. 07Capstone — The Test Rig45 min
17Frameworks & Tooling6 lessons

A framework supplies reusable structure for an application. Development tools help manage its dependencies, check its code and run its work. Compare tools by the problem they solve, and distinguish type checking, validation, concurrency and code-quality checks.

  1. 01Package Managers19 min
  2. 02The Static Typing Ecosystem20 min
  3. 03Choosing a Web Framework20 min
  4. 04Threads and the GIL30 min
  5. 05Multiprocessing and Asyncio40 min
  6. 06Formatters, Linters and Docs19 min
18Capstone — Quarry1 lesson

An end-to-end data pipeline takes raw input through parsing, validation, transformation and storage to a useful result. Assemble Quarry from the earlier components and verify that malformed records, storage boundaries and failures are handled consistently.

  1. 01Capstone — Quarry, End to End40 min
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.