Skip to the workspace
Pebellslearn by building

Learn Python

Understand the language, practise independently, then connect the parts in working programs.

Choose your starting point

New to programming

Set up your tools, learn values and control flow, then build the bill splitter. Every lesson includes a definition and practical examples.

Prepare your workspace →

Already write code

Use the full topic list to focus on Python’s object model, iterators, resource handling, testing and concurrency.

Try engineering interview tasks →

91 lessons · 41 syntax entries · 14 additional practice and interview tasks. Existing lesson exercises remain available throughout the course.

The complete course

91 lessons in 17 sections

Fundamentals

14 lessons

Python fundamentals are the basic rules for writing instructions, representing values and controlling what a program does.

  1. Basic Syntax & Output16 min
  2. Variables & Data Types17 min
  3. Operators & Math18 min
  4. Working with Strings18 min
  5. Conditionals21 min
  6. Loops20 min
  7. Type Casting & Input20 min
  8. Functions27 min
  9. Exceptions & Errors20 min
  10. Built-in Functions20 min
  11. Lists, Tuples & Sets22 min
  12. Dictionaries22 min
  13. Type Annotations20 min
  14. Capstone — Bill Splitter & Tip Calculator40 min

Fundamentals Follow-up Projects

4 lessons

A programming project combines several small concepts into a tool that solves one complete problem.

  1. Project 1 — Terminal Café POS50 min
  2. Project 2 — CSV Data Analyzer50 min
  3. Project 3 — Expense & Budget Tracker50 min
  4. Project 4 — Text Adventure50 min

Objects

7 lessons

Object-oriented programming organizes a program around objects: values that combine their own state with operations on that state.

  1. What Is OOP?18 min
  2. Classes & Instances19 min
  3. Encapsulation20 min
  4. Inheritance20 min
  5. Polymorphism19 min
  6. Abstraction20 min
  7. Dunder Methods19 min

The Object Model

4 lessons

Python’s object model describes how values behave as objects and how names refer to them.

  1. Names, Objects & Identity23 min
  2. Mutable, Immutable & Hashable25 min
  3. What Keeps an Object Alive27 min
  4. Capstone — The Inspector43 min

Iteration & Laziness

4 lessons

Iteration means taking values from a source one at a time. Laziness means postponing work until its result is requested.

  1. Writing an Iterable by Hand25 min
  2. Generators: Functions That Pause25 min
  3. Chaining Generators into a Pipeline27 min
  4. Capstone — The Feed43 min

Functional Python

5 lessons

Functional programming emphasizes composing functions and transforming values. Scope determines which binding a name refers to.

  1. Variable Scope & the LEGB Rule21 min
  2. Lambdas, map, filter & reduce21 min
  3. List & Set Comprehensions19 min
  4. Generator Expressions19 min
  5. Programming Paradigms19 min

Closures & Decorators

6 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.

  1. Closures & the Cell25 min
  2. Decorators27 min
  3. Decorators That Take Arguments27 min
  4. functools27 min
  5. Callables, *args & Signatures25 min
  6. Capstone — The Middleware Ring43 min

The Standard Toolbox

5 lessons

Python’s standard library is the collection of modules supplied with Python for common programming tasks.

  1. Collections: Counter, defaultdict, namedtuple, OrderedDict19 min
  2. deque and heapq19 min
  3. Enum17 min
  4. math and random18 min
  5. itertools19 min

Data Structures in Practice

6 lessons

Applied data structures are concrete ways to organize data so particular operations are easier or less costly.

  1. Arrays & Linked Lists17 min
  2. HashMaps16 min
  3. Stacks, Queues & Heaps17 min
  4. Binary Search Trees18 min
  5. Recursion16 min
  6. Sorting Algorithms17 min

Files, Paths & Encodings

6 lessons

File handling moves data between a program and storage. An encoding specifies how text is represented as bytes.

  1. pathlib25 min
  2. Reading & Writing, Text and Binary27 min
  3. Writing Your Own Context Manager29 min
  4. Unicode, str and bytes29 min
  5. Bytes, Buffers & struct29 min
  6. Capstone — The Yard45 min

Serialisation & Storage

5 lessons

Serialization converts values into a format that can be stored or transmitted. Storage keeps those representations for later use.

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

Text & Patterns

5 lessons

A text pattern describes a shape to find in a string. A regular expression is one language for writing such patterns.

  1. Regular Expressions29 min
  2. Groups, Named Captures & Lookaround29 min
  3. sub, split, finditer & Flags27 min
  4. Catastrophic Backtracking & When Not to Use Regex29 min
  5. Capstone — The Extractor45 min

Modules, Environments & Packaging

3 lessons

A module is a unit of importable Python code. Packaging describes how code, metadata and dependencies are distributed and installed.

  1. Modules, Packages & What import Really Does31 min
  2. Virtual Environments & Pinned Dependencies29 min
  3. pyproject.toml, Wheels & the Console Entry Point31 min

Failure & Observability

3 lessons

Failure handling decides how a program responds when an operation cannot finish. Logging records events that help explain what happened.

  1. The Hierarchy, `raise from` & `finally`33 min
  2. Logging31 min
  3. Capstone — The Black Box45 min

Testing & Debugging

7 lessons

Testing compares observed behavior with an explicit expectation. Debugging investigates why the behavior differs from that expectation.

  1. Your First pytest Suite27 min
  2. Fixtures, Parametrisation & Scope29 min
  3. Doubles, patch & Test Seams31 min
  4. Properties, Coverage & Honest Green29 min
  5. pdb, Post-Mortem & Bisecting29 min
  6. unittest, doctest & tox25 min
  7. Capstone — The Test Rig45 min

Frameworks & Tooling

6 lessons

A framework supplies reusable structure for an application. Development tools help manage its dependencies, check its code and run its work.

  1. Package Managers19 min
  2. The Static Typing Ecosystem20 min
  3. Choosing a Web Framework20 min
  4. Threads and the GIL30 min
  5. Multiprocessing and Asyncio40 min
  6. Formatters, Linters and Docs19 min

Capstone — Quarry

1 lessons

An end-to-end data pipeline takes raw input through parsing, validation, transformation and storage to a useful result.

  1. Capstone — 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.