Python Programming

An original Python-language curriculum, from fundamentals through idiomatic, production-ready Python.

7 parts · written by Pratik Dhanave. Start with Part 1 →

← All series · All posts

Part 1 · ·11 min read

Python's Philosophy and Toolchain

What actually makes Python distinctive — the design values that shape the language, how it runs, and the everyday tools you'll live in. The first post in a series that treats readability and correctness as features, not afterthoughts.

What actually makes Python *Python* — the design values that shape the language, how it runs, and the everyday tools you'll live in. The first post in a series that treats readability and correctness as...

Part 2 · ·12 min read

The Data Model: Objects, Names, and Binding

The single mental model that explains most of Python's surprises — everything is an object with an identity, a type, and a value; a name is a reference bound to an object, not a box that holds one; and assignment binds, it never copies.

The single mental model that explains most of Python's surprises — everything is an object with an identity, a type, and a value; a name is a reference bound to an object, not a box that holds one; and...

Part 3 · ·13 min read

Numbers, Booleans, and None

A working guide to Python's scalar types — arbitrary-precision integers, IEEE-754 floats and the 0.1 + 0.2 trap, when to reach for Decimal and Fraction, the operators that surprise you with negatives, why a boolean is secretly an integer, and how truthiness and None actually work.

A working guide to Python's scalar types — arbitrary-precision integers, IEEE-754 floats and the 0.1 + 0.2 trap, when to reach for Decimal and Fraction, the operators that surprise you with negatives, why a...

Part 4 · ·12 min read

Strings, Bytes, and Unicode

Why Python draws a hard line between text and raw bytes, how the encode/decode boundary works, and the string-handling habits that keep that line from cutting you.

Why Python draws a hard line between text and raw bytes, how the encode/decode boundary works, and the string-handling habits that keep that line from cutting you.

Part 5 · ·11 min read

Control Flow: if, for, while, and match

How Python decides what runs next — conditionals and the ternary, for-each iteration done idiomatically, while loops, break/continue and the surprising loop-else, structural pattern matching with match/case, and where truthiness and comprehensions fit in.

How Python decides what runs next — conditionals and the ternary, for-each iteration done idiomatically, while loops, break/continue and the surprising loop-else, structural pattern matching with...

Part 6 · ·11 min read

Functions: Arguments, *args, **kwargs, and Defaults

A working guide to Python's function signatures — positional and keyword arguments, default values and the mutable-default trap, arbitrary-argument packing and call-site unpacking, keyword-only and positional-only parameters, and treating functions as first-class values.

A working guide to Python's function signatures — positional and keyword arguments, default values and the mutable-default trap, packing with *args/**kwargs, unpacking at call sites, keyword-only and...

Part 7 · ·9 min read

Closures and Scope: LEGB, nonlocal, and global

How Python decides what a name means — the LEGB lookup rule, what a closure actually captures, the late-binding loop trap and its fixes, and when you genuinely need `nonlocal` or `global`.

How Python decides what a name means — the LEGB lookup rule, what a closure actually captures, the late-binding loop trap and its fixes, and when you genuinely need `nonlocal` or `global`.

This series is part of a larger body of work by Pratik Dhanave, an Agentic AI Architect writing about production AI systems, distributed systems, and cloud-native engineering. Explore all course series, browse every post, or find topics via the tag index.