Library · Summary & review

Python Crash Course

By Eric Matthes. The world's best-selling Python introduction, written by a high school teacher: the basics, then three real projects.

FR EN
Python Crash Course book cover, Eric Matthes

Python Crash Course

Python Crash Course: A Hands-On, Project-Based Introduction to Programming

6.5 /10

« Not the best book about Python: the best first book, which is much rarer. »

  • AuthorEric Matthes · « prof de maths au lycée pendant 25 ans »
  • OriginalNo Starch Press, 2023 · 552 pages
  • Edition3rd edition (2023), over a million copies in print
  • This page~10 min read
Book rating across 6 dimensionsIdeas4.5/10Practical7.5/10Readability9/10Aged well7.5/10Examples7.5/10Depth3/10

The world's best-selling Python introduction: the basics, then three real projects (game, data viz, web).

Why this book

"Where do I start?" is the question I get asked most often, and it's the hardest one. Not because resources are scarce: because there are too many, and most of them drown the beginner in everything they don't need to know yet. Python Crash Course is the answer the market settled on. Its preface cites more than a million copies in print and translations in over ten languages. Its publisher calls it the world's best-selling guide to the Python programming language.

I read it wearing two hats. The developer who wants a reliable recommendation to hand out. And someone who spends his evenings building courses for beginners: Eric Matthes was a high school science, math and programming teacher before becoming a full-time author. This book is what years of classroom experience produce when you compress them into 552 pages. That's worth studying.

The ideas that stick

The book runs 552 pages in two halves: eleven chapters of basics, then three complete projects to pick from. Here is what stays once it's closed.

1A "well-curated" course, not an encyclopedia

A beginner's book should be judged by what it leaves out. Matthes explains in his preface that his main goal in revising the book is to keep it a well-curated introductory course. Concretely, every edition cuts as much as it adds. The 3rd:

  • replaces unittest with pytest (the testing tool that became the standard);
  • swaps the old open() for pathlib (the modern way to handle files);
  • drops Heroku for Platform.sh (two hosting services);
  • sets the beginner up on VS Code (a free code editor).

Advanced tools (dict comprehensions, decorators, metaclasses) can wait: not because they're useless, but because it's not the day. That selection is the real pedagogical work: deciding the order and the subset, and owning the cuts at every edition.

2Variables are labels, not boxes

Almost every beginner course explains that a variable is "a box that holds a value". Matthes corrects it as early as page 18: "this idea can be helpful the first few times you use a variable, but it isn't an accurate way to describe how variables are represented internally in Python. It's much better to think of variables as labels that you can assign to values."

The difference looks cosmetic; it's fundamental. A box contains ITS value, so assignment should copy. In Python, assignment sticks one more label onto the same object. The day two variables mysteriously "share" a list (you change one, the other changes too), the box model collapses and the label model explains everything.

Giving the right mental model in chapter 2, before the trap is even possible, is what separates a designed course from a recited one.

3Errors are made on purpose

According to the book, the first chapter has you put a typo into your very first program on purpose, just to see what happens. Breaking the program is an exercise, not an accident.

Here is what such a typo gives with recent Python: you type mesage instead of message, and the traceback (the error report Python prints) points at the exact spot and even suggests the fix. Matthes defuses the shame: "many programming errors are simple, single-character typos in one line of a program. If you find yourself spending a long time searching for one of these errors, know that you're in good company" (p. 18).

The implicit lesson holds for any language: an error isn't a failure, it's the standard output of the trade, and reading a traceback is a skill you can teach, not a gift.

Traceback (most recent call last):
  File "hello_world.py", line 2,
    in <module>
    print(mesage)
          ^^^^^^
NameError: name 'mesage' is
not defined. Did you mean:
'message'?

4"Now is better than never"

At the end of chapter 2, Matthes has you type import this and comments a few lines of the Zen of Python (a short list of the language's guiding sayings). The one he saves for last is a learning program all by itself: "Now is better than never. You could spend the rest of your life learning all the intricacies of Python and of programming in general, but then you'd never complete any projects" (p. 31).

The whole book flows from that line: you don't learn the language to know it, you learn just enough to build something that works, and you fill in the gaps along the way. It's anti-perfectionism turned into a method, and it's exactly the reflex missing in beginners who collect tutorials without ever finishing anything.

5The plan is prose, the refactoring happens en route

Chapter 12 opens the first project (a Space-Invaders-style game) with a project management lesson in disguise. First, the book insists on preparing a plan before writing any code. According to it, that plan is not a forty-page spec: it's one paragraph of prose describing the game.

Then the first increment is tiny: an empty window, created with Pygame (a game-making library), that opens and closes. After that, every round runs the same loop: add one small feature, check it on screen, and refactor (clean up the code without changing what it does) BEFORE adding the next one.

Matthes says it in so many words: on a large project you often refactor the code you've already written before adding more. So you start by writing it as simply as possible, and clean it up as the project grows. Refactoring is not the end-of-project cleanup: it's a step in every single loop.

6Testing is a beginner skill

The book's most unexpected choice: chapter 11, still in the "basics" half, teaches pytest. Not as an option, not in an appendix: between files and the first project. The argument lands in the very first pages: testing your code is one of the first skills that move you from beginner to intermediate programmer.

The demonstration is crystal clear: a function that formats names (Janis Joplin comes out as "Janis Joplin"), a passing test, then a middle name gets added and the test breaks. The rule that follows deserves engraving: when a test fails, don't change the test, fix the code, because other calls break exactly like the test did.

And the rare honesty: don't aim for full coverage in early projects without a specific reason. Test early, yes. The coverage dogma (testing every single line), no.

from name_function import (
    get_formatted_name)

def test_first_last_name():
    name = get_formatted_name(
        'janis', 'joplin')
    assert name == 'Janis Joplin'

7OOP is for modeling, not reciting

The classes chapter boils down to one idea: a class is a set of instructions for making instances (objects built from it). The running example is deliberately mundane: a Dog class with a name and an age, then a Car extended into an ElectricCar, whose battery becomes a separate Battery class.

He names the technique, composition: the car doesn't store battery details itself, it holds a Battery object that handles them.

class Battery:
    # its only job: the battery
    def __init__(self, kwh=75):
        self.kwh = kwh

    def range(self):
        return self.kwh * 5  # km

class ElectricCar(Car):
    def __init__(self, make):
        super().__init__(make)
        # the car HAS-A battery
        self.battery = Battery()

# delegate to the object
# that knows
my_tesla.battery.range()

The day the battery gets more complex (charging, degradation, models), it all stays inside Battery, and the car knows nothing about it. But the real lesson comes when the book makes you think about what you're modeling: not Python, but how to represent the real world in code.

And again, the curation: @property, class methods and special methods beyond __init__ are advanced syntax that can wait. Model first.

8Three projects, three doors into the trade

The second half of the book is three complete, independent projects, in any order you like:

  • a game (Alien Invasion, with Pygame, a game library);
  • data visualization (matplotlib then Plotly, two chart libraries);
  • a web application (a learning journal in Django, a web framework).

Three projects = three possible careers, and the reader picks a door. The detail that changes everything: the data is real. The weather comes from records for Sitka, Alaska, and Death Valley. The earthquakes come from the real-time feed of the USGS (the US geological survey). The most-starred repositories come from the GitHub API (the interface GitHub offers to read its data). And the Django project goes all the way: Bootstrap (a ready-made styling kit), user accounts, and a real deployment on Platform.sh, DEBUG=False included (debug mode off, as a public site requires). A beginner's book that ends with your app online, reachable by the whole world, is still the exception.

A person at a crossroads where three paths diverge: a pixelated alien spaceship (the game), a browser window (the web app), a bar chart (data visualization), with a friendly python snake coiled on the signpost pointing all three ways
Three projects, three doors: game, data, web. The snake has no preference.

Three things I didn't know

My take, honestly

This book does one single thing, and does it better than anyone: turning someone who has never coded into someone who has finished a real project. The pedagogy is remarkably clean: every notion arrives with the simplest possible example, immediate exercises, and the traps are defused before they're ever met. Writing my own courses, I found in it just about every lesson it took me years to learn, already applied, without noise.

Let's be honest about what it isn't. If you already know how to program, you will be bored: two full chapters on lists is the pace of a first book, not of an express conversion from JavaScript. And it almost never explains how Python works under the hood: it gives you the right move, rarely the mechanics underneath. That's a deliberate choice, the right one for its audience, but you should know it: you come out able to build, not to shine in an interview about the memory model.

Hence my rule: Python Crash Course is the first book; Fluent Python (already in this library) is the thirteenth. One teaches you to write Python that works, the other to speak the Python of natives. Their ratings don't compare: you don't grade a front door the way you grade a cathedral.

Odilon

Still relevant in 2026?

For this book the question reads differently: is learning to code still worth it when AI writes the code? Answer: Matthes' method is precisely the one you need to work with an AI. Describe what you want in clear prose, ask for the smallest increment that runs, check it, refactor before adding: that's his loop from idea 5, and it's word for word how you drive a coding assistant.

As for reading a traceback and judging what's too big or badly split, that's exactly what separates the person who drives the AI from the person who endures it. The 3rd edition (2023) is current: pytest, pathlib, VS Code. Only the last project will age: Django 4.1 and Platform.sh are dated choices by nature, and the author maintains the fixes on the official repo.

Who is it for?

Read it if

  • You've never programmed and you want ONE book, not a list of 40 resources
  • You're switching careers and need solid basics plus three projects to show
  • You know the syntax but you've never finished a complete project
  • You teach or build learning content: it's a textbook case of course design

Skip it if

  • You already write Python daily: go straight to Fluent Python
  • You come from another language and just need the syntax: the docs and a good cheat sheet will do
  • You want the internals (memory, typing, the GIL, the lock that runs one thread at a time): that's not what this is

Going further

This book's method can be practiced in my free courses: the step-by-step basics in the Python course, the plan → increment → refactor loop in Coding with AI, and chapter 11 continues in the testing course. The complete code for all twenty chapters, the solutions and the cheat sheets live on the author's official repository. And if you're still hesitating on the first step: Where to start.

Comments (0)

On the same shelf

Server-side languages

See the whole shelf (6 notes) →

Browse the whole library

More book notes coming: one book at a time, the marrow only.