A college library keeps its issue register as a plain text file, one line for every book that goes out. By the end of the year the file has forty thousand lines. On Monday morning the librarian asks you for two things: every line that mentions "Python", and a count of the books issued last week. Think for a moment about what that program needs. It shouldn't load forty thousand lines into memory just to look at them one by one. It must survive a garbled line, because somebody typed 7O with a letter O instead of a zero. It must say something sensible when the file isn't there. And sooner or later you'll want a Book and a Member to be real things in the program, not loose strings.
Last chapter ended with a function that calls itself and waits for its own answer. That was Python working only on data it creates itself. This chapter is about Python meeting the outside world, and about the habits that keep a program calm when that world misbehaves.
By the end you'll be able to make a function that hands out values one at a time instead of building a whole list, and say why that matters for a big file. You'll catch an error you expected, let the others through, clean up whatever happens, and raise your own error with its own name. You'll read a file line by line, write one without losing the old content by accident, and convert a picture from JPEG to PNG. You'll write a Python class the way Python programmers do, with properties and special methods, and answer a "write a bank account class" question in full. And you'll recognise the newer features (the walrus, match, dataclasses, type hints) and the neighbours the exams like to compare Python with: generics, lambdas, threads and memory safety in Java, C++ and Rust.