The full path

Fifty short Python lessons.

Start at the top if you are new. Fifty lessons follow one coffee cart, from the first hand-written receipt to a model that watches its own drift. Each lesson ends with a runnable example and twelve practice questions.

01

Python Print and Strings

Make Python show text, combine values, and format messages you can actually read.

Beginner18 min read12 questions
02

Python Variables and Types

Store values in named variables and learn how Python decides what kind of value you have.

Beginner18 min read12 questions
03

Python String Methods

Clean, split, join, and inspect text with the string methods you will use every day.

Beginner18 min read12 questions
04

Python If, Elif, and Else

Make programs choose between paths with comparisons and boolean logic.

Beginner18 min read12 questions
05

Python For Loops

Repeat work over a collection and build totals without writing the same line again.

Beginner19 min read12 questions
06

Python Lists

Keep an ordered collection, change it safely, and pull out the parts you need.

Beginner18 min read12 questions
07

Python Dictionaries

Store labelled values and look them up by name instead of by position.

Beginner19 min read12 questions
08

Python Functions

Package a calculation once, give it a name, and reuse it without copying code.

Beginner19 min read12 questions
09

Python Error Handling

Catch predictable failures, show a useful fallback, and keep the program running.

Beginner19 min read12 questions
10

Python JSON for Beginners

Turn JSON text into Python values, inspect nested records, and send data back as JSON.

Beginner18 min read12 questions
11

Python while Loops

Repeat work until a condition changes, and know when to stop.

Beginner19 min read12 questions
12

Python Tuples and Sets

Choose a fixed record or a unique collection, and use each one deliberately.

Beginner18 min read12 questions
13

Python List Comprehensions

Build a new collection from an old one without writing a long loop.

Beginner18 min read12 questions
14

Python Sorting and Key Functions

Put data in order by the field you actually care about.

Beginner19 min read12 questions
15

Python Classes and Objects

Group data and the functions that work on it into a small, reusable object.

Beginner19 min read12 questions
16

Python Modules and Imports

Use code that already exists instead of rebuilding it.

Intermediate18 min read12 questions
17

Python Nested Data

Work with JSON-like data one level at a time.

Intermediate19 min read12 questions
18

Python Lambda, map, and filter

Write short functions and transform sequences without a loop.

Intermediate18 min read12 questions
19

Python Recursion

Solve a problem by calling a smaller version of itself.

Intermediate20 min read12 questions
20

Python Regular Expressions

Find and replace text patterns without writing a manual parser.

Intermediate20 min read12 questions
21

Python enumerate and zip

Add positions and pair sequences without manual counters.

Intermediate18 min read12 questions
22

Python Paths with pathlib

Treat file paths as objects instead of fragile strings.

Intermediate19 min read12 questions
23

Python Dates and Times with datetime

Work with calendar dates and simple durations accurately.

Intermediate19 min read12 questions
24

Python Testing with assert

Turn expected behavior into checks you can run again.

Intermediate18 min read12 questions
25

Python Type Hints

Make the shape of your data visible to readers and tools.

Intermediate19 min read12 questions
26

Python Generators

Produce values lazily instead of building a full list.

Intermediate20 min read12 questions
27

Python Decorators

Wrap a function with reusable behavior without editing its body.

Intermediate20 min read12 questions
28

Python Context Managers

Guarantee setup and cleanup with a with block.

Intermediate20 min read12 questions
29

Python Dataclasses

Declare data-focused classes without repetitive boilerplate.

Intermediate19 min read12 questions
30

Python itertools

Compose lazy iterators for counting, chaining, and grouping.

Intermediate20 min read12 questions
31

Python collections

Reach for the right container instead of rebuilding it by hand.

Intermediate19 min read12 questions
32

Python functools

Reuse function behavior with caching, partial application, and reduction.

Intermediate19 min read12 questions
33

Python Enums

Name a fixed set of values once and use the names everywhere.

Intermediate18 min read12 questions
34

Python CSV Files

Read and write tabular text without splitting lines by hand.

Intermediate19 min read12 questions
35

Python Logging

Record what happened with levels, handlers, and formats.

Intermediate19 min read12 questions
36

Python HTTP requests for scraping

Build a polite request before you parse a single tag.

Practical19 min read12 questions
37

Python HTML parsing

Let a parser track HTML structure instead of guessing with regex.

Practical18 min read12 questions
38

Python URL parsing

Resolve relative links correctly before they enter the crawl queue.

Practical18 min read12 questions
39

Python pagination and deduplication

A crawl is a queue with a memory and a budget.

Practical19 min read12 questions
40

Python robots.txt and polite scraping

Permission, limits, and privacy are part of the scraper.

Practical19 min read12 questions
41

Python tokens and text vectors

Turn text into tokens, then compare documents as vectors.

Foundations19 min read12 questions
42

Python softmax and temperature

Turn raw scores into a probability distribution without overflow.

Foundations18 min read12 questions
43

Python nearest-neighbor classifier

Classify a point by looking at the neighbors it resembles.

Practical19 min read12 questions
44

Python model evaluation and accuracy

A score is only useful when you know what it measured.

Practical19 min read12 questions
45

Python prompt templates and structured output

Treat model output as untrusted input, not as finished data.

Practical20 min read12 questions
46

Python linear regression from scratch

Fit a line, make a prediction, and measure how wrong it is.

Applied19 min read12 questions
47

Python gradient descent, step by step

Follow the gradient downhill and watch the learning rate matter.

Applied19 min read12 questions
48

Python Naive Bayes text classifier

Classify short texts with counts, priors, and smoothing.

Applied19 min read12 questions
49

Python k-means clustering from scratch

Assign points, move centroids, and repeat until stable.

Applied19 min read12 questions
50

Python model monitoring and drift checks

Compare live behavior with a baseline before users notice.

Applied19 min read12 questions