COGNITION FOUNDRYLEARN. BUILD. UNDERSTAND.
LEARNING PATH / PYTHON

Make Python make sense.

Start with the first instruction, then follow each idea into the next. No fixed difficulty labels. No useless filler. Working examples you can change.

24 connected lessons89 verified example scriptsEditable browser playground
THE LEARNING PATH

Choose a lesson.

PY-00112 min

Meet Python

Understand what Python executes, how scripts differ from the interactive prompt, and why a browser playground has limits.

Read + experiment
PY-00214 min

Output and expressions

Find out what expressions are and why a calculation does not automatically print inside a script.

Read + experiment
PY-00316 min

Values and types

Meet text, whole numbers, decimal numbers and booleans, and inspect their types with `type()`.

Read + experiment
PY-00417 min

Variables and names

Store values with assignment, choose readable names and update them without confusing = with comparison.

Read + experiment
PY-00519 min

Strings and text

Create strings, format readable messages and learn why quotation marks and backslashes matter.

Read + experiment
PY-00618 min

Numbers and calculations

Work with arithmetic, division, rounding and the important limits of floating-point numbers.

Read + experiment
PY-00717 min

Comparisons and boolean logic

Compare values, combine conditions and understand why Python treats some values as true or false.

Read + experiment
PY-00818 min

Conditions and branches

Use if, elif and else to choose actions, and understand indentation and mutually exclusive branches.

Read + experiment
PY-00918 min

For loops and range

Repeat operations with for, iterate over strings and use range without off-by-one surprises.

Read + experiment
PY-01020 min

While loops and loop control

Use while, break and continue responsibly, and guard against accidentally endless loops.

Read + experiment
PY-01120 min

Lists and indexes

Create and modify lists, read elements by index and loop over collections without going out of range.

Read + experiment
PY-01220 min

Dictionaries and keyed data

Store related facts using dictionary keys, retrieve values safely and iterate through records.

Read + experiment
PY-01319 min

Writing your first functions

Use def to group a repeatable task, call it deliberately, and keep repeated code in one place.

Read + experiment
PY-01421 min

Parameters and arguments

Pass data into functions using parameters, arguments, keyword calls and sensible defaults.

Read + experiment
PY-01522 min

Return values and composition

Learn why returning values differs from printing, and combine smaller functions into reusable calculations.

Read + experiment
PY-01619 min

Scope and predictable functions

Understand function-local variables, global names, shadowing and why explicit inputs avoid surprising state.

Read + experiment
PY-01723 min

Validation and exceptions

Recognise error types, convert input with try/except and reject invalid values with useful messages.

Read + experiment
PY-01824 min

Modules, imports and first tests

Import standard-library modules, write basic assertions and understand how two .py files work together locally.

Read + experiment
PY-01919 min

Cleaning and normalising text

Trim unwanted whitespace, compare text reliably and keep meaningful characters intact.

Read + experiment
PY-02018 min

Finding, splitting and replacing text

Locate text, split fields, replace known content and preserve everything else.

Read + experiment
PY-02123 min

Quotes, backslashes and Python literals

Understand path quotes, escaped backslashes, raw strings and safe boundary quote removal.

Read + experiment
PY-02221 min

Accepting and validating input

Build user-input checks and learn how terminal input differs from browser demonstration code.

Read + experiment
PY-02322 min

Paths with pathlib

Explore path names, suffixes, parents and joins without touching the local filesystem.

Read + experiment
PY-02420 min

Practice with string functions

Combine cleaning, targeted replacement, checks and small functions through editable Python practice.

Read + experiment
How to use the playground

Open any lesson and choose an example. Every code block is editable; Run executes Python in your browser once the runtime loads. First run downloads a pinned Python runtime, so internet access is required for the initial load. You can still read and copy code without it.