A free course, written in public

Python for Humans

Learn to code by hand, at human pace, with real Python running right in the page.

Free to read. 26 of 26 chapters posted so far.

Try it now. Click below, type your name in quotes, and press Enter:name = 'Ada'

Contents

Chapters go up here as they're written. Each post is a draft, with its version and date on the page.

Introduction draft v0.3

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. 1 Let's Write Some Python v0.2
  2. 2 Making Decisions v0.2
  3. 3 Loops v0.6
  4. 4 Keeping Things Together v0.4
  5. ↳ Tic-Tac-Toe: Your Move project
  6. 5 Reading a File v0.4
  7. 6 Keeping Count v0.2
  8. 7 Giving Code a Name v0.2
  9. ↳ Tic-Tac-Toe: Three in a Row project
  10. 8 The Word-Prediction Generator v0.3
  11. ↳ Tic-Tac-Toe: Meet Your Opponent project
  12. ↳ Text Adventure: Explore the Castle optional project

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.

  1. 9 Keeping Your Work v0.1
  2. 10 Errors and debugging v0.1
  3. 11 Testing v0.1
  4. ↳ Tic-Tac-Toe: Can You Beat It? optional project
  5. 12 Files and the filesystem v0.1
  6. ↳ Text Adventure: Save Your Adventure optional project
  7. 13 Modules and several files v0.1
  8. 14 Packages and uv v0.1
  9. 15 The web in one chapter v0.1
  10. 16 Classes v0.1
  11. ↳ Text Adventure: Meet the Castle's Characters optional project
  12. 17 The other side of the web: Django (optional) v0.1

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.

  1. 18 Choose a Project v0.1
  2. 19 Dodge the Blocks v0.1
  3. 20 Your Reading List v0.1
  4. 21 Your First API v0.2
  5. 22 Explore Real Data v0.1
  6. 23 Train Your First Model v0.1
  7. 24 Teach Python to Spot Spam v0.1
  8. 25 Where Next v0.1
Will Vincent

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.