A free course, written in public
Python for Humans
Start coding in your browser, then build Python projects on your own computer.
This course is a work in progress.
Contents
Chapters go up here as they're written. Each post is a draft, with its version and date on the page.
Part I · Python fundamentals
Thinking in code
Python runs in the page, so there's nothing to install. Small programs that talk, count, decide and repeat; then lists, dictionaries and functions, put to work on pizza orders, high scores and the complete works of Shakespeare. Finish by generating new Shakespeare with your own code.
- 1 Strings, Strings, Strings Change, search, and build text with string methods and f-strings.
- 2 Numbers Integers, Floats & Arithmetic
- 3 Making Decisions If & Conditionals
- 4 Loops While & For Loops
- 5 Keeping Things Together Lists & Indexing
- ↳ Tic-Tac-Toe: Your Move
- 6 Reading a File Text Files & Strings
- 7 Keeping Count Dictionaries & Key–Value Pairs
- 8 Shakespeare's Favorite Words Sorting, Sets & Tuples
- ↳ Hangman
- 9 Giving Code a Name Functions & Return Values
- ↳ Tic-Tac-Toe: Three in a Row
- 10 Try Again Handling Bad Input
- 11 The Word-Prediction Generator Randomness & Text Generation
- ↳ Tic-Tac-Toe: Meet Your Opponent
- ↳ Tic-Tac-Toe: Can You Beat It?
- ↳ Text Adventure: Explore the Castle
Part II · Data science and machine learning
Data and models
For anyone who has finished Part I. Still in the browser, now in a notebook. Load a real dataset, ask it questions and draw a chart, train your first model, teach Python to spot spam, and finish with a tiny neural network that learns Shakespeare.
- 12 Meet the Notebook Notebooks & Tables
- 13 Explore Real Data Data Science
- 14 Train Your First Model Machine Learning
- 15 Teach Python to Spot Spam Text Classification
- 16 A Tiny Neural Network Neural Networks
Part III · Installing and running Python
Your own computer
For anyone who has finished Part I. Install Python and take your programs out of the browser, then save what you make to your own files. Games and the web both start from here.
Part IV · Classes and Pygame
Games
For anyone who has finished Part III. Build a card game with classes, then an arrow-key game with falling blocks and a space game where you shoot asteroids.
- 19 A Card Game Objects, Attributes & Methods
- ↳ Text Adventure: Meet the Castle's Characters
- 20 Dodge the Blocks Games
- 21 Asteroid Field Games
Part V · Live data and APIs
The web
For anyone who has finished Part III. Fetch live data from other people's services, then put your own code on the web with a small API.
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.