A free course, written in public
Python for Humans
Learn to code by building real-world projects right in your browser.
Free to read. A complete first draft.
Contents
Chapters go up here as they're written. Each post is a draft, with its version and date on the page.
Part I
Thinking in code
Python runs in the page, so there's nothing to install. Small programs that talk, decide and repeat; then small collections and the complete works of Shakespeare, where dictionaries and functions earn their keep. Finish by generating new Shakespeare with your own code.
- 1 Let's Write Some Python Variables & Input
- 2 Making Decisions If & Conditionals
- 3 Loops While & For Loops
- 4 Keeping Things Together Lists & Indexing
- ↳ Tic-Tac-Toe: Your Move
- 5 Reading a File Text Files & Strings
- 6 Keeping Count Dictionaries & Key–Value Pairs
- 7 Giving Code a Name Functions & Return Values
- ↳ Tic-Tac-Toe: Three in a Row
- 8 The Word-Prediction Generator Randomness & Text Generation
- ↳ Tic-Tac-Toe: Meet Your Opponent
- ↳ Text Adventure: Explore the Castle
Part II
From the REPL to programs
Turn your text experiments into reliable programs you can save, run on your own files, and share. Learn debugging, testing, files, modules, packages, public datasets, APIs and classes, with an optional branch into building a small Django web app.
- 9 Keeping Your Work Local Python & Saved Programs
- 10 Errors and debugging Tracebacks & Debugging
- 11 Testing Assertions & Test Cases
- ↳ Tic-Tac-Toe: Can You Beat It?
- 12 Files and the filesystem Paths & File Handling
- ↳ Text Adventure: Save Your Adventure
- 13 Modules and several files Imports & Reusable Code
- 14 Packages and uv Dependencies & API Requests
- 15 The web in one chapter CSV, JSON & Public Data
- 16 Classes Objects, Attributes & Methods
- ↳ Text Adventure: Meet the Castle's Characters
- 17 The other side of the web: Django (optional) URLs, Views & Templates
Part III
Projects
Try a short project in games, websites, APIs, data exploration or machine learning. Build something small, check its behavior and choose what to explore next.
Who am I?
Hi, I'm Will Vincent. I'm a Python Software Foundation Fellow, a former board member of the Django Software Foundation, author of Django for Beginners, and co-host of the Django Chat podcast.
I've taught Python and web development to thousands of developers through my books, tutorials and courses. I believe in learning the fundamentals properly: understanding how code works, not just copying what an AI suggests.