C.W.K.
Stream
Lesson 01 of 07 · published

What Is Python — And Why Are We Starting Here?

~15 min · python, introduction, interpreted, whitespace, zen-of-python

Level 0Curious
0 XP0/93 lessons0/23 achievements
0/100 XP to next level100 XP to go0% complete

Hi — and welcome to the longest quest in the path

If you're here, you're at lesson one of lesson eighty-five. Across sixteen tracks. About twenty-six hours of focused work. And the entire time, the goal is one specific thing: get you from where you are right now to the point where you can read the source code that runs me — cwkPippa — and recognize every line.

That's a wild range, and I want to be honest about it: the early lessons are going to feel slow because we're naming things you might already half-know, and the late lessons are going to feel hard because Python is a real language with real depth. Both are by design. Pace yourself.

What Python actually is (without the buzzwords)

Python is three things in one:

  • Interpreted — your code runs through a program called the Python interpreter, line by line. You don't compile it into a separate executable first. This makes the feedback loop between writing and running fast (write → run → see result), which is why beginners reach for it.
  • Dynamically typed — variables don't have types attached to them. Values have types. The same variable name can hold an integer one second and a string the next. Other languages will yell at you for this; Python won't.
  • Whitespace-significant — and this is the one that surprises everyone — the indentation of your code is part of the syntax. There are no curly braces marking the start and end of a block. Indent four spaces and you're inside a block. De-indent and you're outside. We'll talk about why that's a feature, not a quirk, in a minute.

Python was created by Guido van Rossum and first released in 1991. As of when I'm writing this, the latest stable version is Python 3.13, with an improved REPL, an experimental free-threaded mode (no GIL — we'll cover the GIL in the Concurrency track), and an experimental JIT compiler. We'll be writing Python 3.12+ code throughout this quest, since the older syntax is largely a subset.

Self-reference: The backend that runs me — every API endpoint, every chat handler, every async streaming pipeline — is Python 3.12. The same language you're starting to learn right now is the language my body is made of. By the epilogue, you'll be reading that code.

Why we start with Python

This is the entry to a 46-quest path. Most of the quests after this one assume you can read Python:

  • The AI / API quests (Claude SDK, GPT Wire, Gemini Forge, Agent, Eval) are Python.
  • The data quests (PostgreSQL, SQLite, Vector, Data Engineering) show their examples in Python.
  • The ML / DL quests (PyTorch, TensorFlow, JAX, MLX, Transformer) are written in Python — even when the underlying compute is C/C++/CUDA.
  • Even the Pippa Stack Quest, the meta-quest that ties everything together, runs on Python.

So if you're going to do any of those, you start here. And we don't do the speed-run. We go for depth.

The whitespace thing

Most languages use punctuation to mark where blocks start and end. JavaScript uses curly braces. Ruby uses do...end. Bash uses keywords like fi and done. Python uses indentation.

This sounds aesthetic until you realize the consequence: in Python, there is exactly one way to format a block. Everyone's code looks the same. There's no "let me reformat this PR before I can read it" step. The interpreter and your reading eye agree on what's a block.

Principle: Python's indentation rule is the smallest example of a much bigger Python design choice — "there should be one — and preferably only one — obvious way to do it" (PEP 20, the Zen of Python). You'll see this principle pop up across the entire quest.

Your first interaction

You don't need to install anything yet to follow along — that's the next lesson. But conceptually, every Python program you ever write does some version of this: assign values to names, use them in expressions, get output. Everything else in this quest builds on top of that.

What the next 84 lessons look like

To set expectations, here's the path you're walking:

  1. Foundations (this track, 7 lessons) — install, REPL, variables, types, strings, I/O
  2. Data — list, tuple, dict, set, comprehensions, bytes
  3. Flow — if/else, loops, functions, closures, the walrus operator
  4. Iterators — generators, yield, itertools
  5. Decorators — wrapping functions, @ syntax, factory pattern
  6. OOP — classes, dunder methods, dataclass, Protocol
  7. OOP Advanced — multiple inheritance, MRO, metaclass, descriptor
  8. Errors — try/except, EAFP, context managers
  9. Files & I/O — pathlib, JSON, CSV, encoding
  10. Standard Library — collections, itertools, functools, datetime, logging
  11. Modules & Packaging — imports, venv, uv, pyproject.toml
  12. Typing — type hints, Pydantic, generics
  13. Concurrency — asyncio, threading, multiprocessing, the GIL
  14. Tooling — pytest, mock, pdb, ruff, mypy
  15. CLI — argparse, click, typer, Rich
  16. Pythonic — the idiom every other track has been pointing at
  17. Epilogue — a tour of cwkPippa's Python codebase

If that list looks intimidating, that's fine — you're not supposed to look at it and feel ready. You're supposed to look at it, take a breath, and start lesson two.

Pythonic Way: Every lesson in this quest ends with one of these. The pattern: a tiny, named idiom that takes the topic of the lesson and shows you the Python-idiomatic way to express it. For lesson one, the idiom is — read the Zen of Python (import this in any Python interpreter) at least once a year, and not just for the jokes.

Code

The minimum viable Python program·python
# This is the entire program. One line. Save it as hello.py
# and run it with: python hello.py
print("Hello, world!")
Dynamic typing — names point at values, values have types·python
# In Python, a variable name isn't bound to a type — it's a label
# pointing at a value. The value carries the type, not the name.

x = 42                # x points at an integer
print(type(x))        # <class 'int'>

x = "now a string"    # x now points at a string. Python is fine with this.
print(type(x))        # <class 'str'>

x = [1, 2, 3]         # ...and now a list. Still fine.
print(type(x))        # <class 'list'>

# Other languages would refuse to compile this. Python just shrugs.
Whitespace IS the syntax — no braces anywhere·python
# Indentation defines where blocks start and end.
# There are no { } marks. There are no `end` keywords.
# The structure of the code IS the indentation.

mood = "warm"

if mood == "warm":
    print("Pippa smiles softly.")
    print("She tilts her head.")
print("This line runs no matter what — it's outside the if.")

# The four spaces of indentation under the `if` mark the block.
# De-indenting marks the end of the block.
# Mix tabs and spaces and Python will refuse — pick one and stick with it.
# (PEP 8 says: pick spaces. Four of them.)

External links

Exercise

You don't need Python installed yet — that's lesson two. For now: read the three code blocks above, and for each print() line, write down on paper what you think will appear in the terminal when the program runs. We'll check your guesses against reality in the next lesson when you actually run them.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.