Foundations — Exception hierarchy
Before you can talk about "children" and "parents" of exceptions, you need to know what a class, an object, and inheritance actually are. This page builds every one of those from nothing, in the exact order the parent note secretly relies on them.
1. What is an "error" as a thing?
When you write ordinary code, values are things like 5, "hi", [1, 2, 3]. When something goes wrong, Python does not just print a message and quit — it creates a value that represents the problem, and then throws it outward toward whoever is watching.
Picture it as an envelope with a label and a note inside.

Why the topic needs this: the whole hierarchy is a hierarchy of these objects' types. If you think an error is "just a printed message", nothing later makes sense. The error is a thing with a type, and types are what get organised into a tree.
2. Class vs. object — the cookie cutter and the cookie
The label on the envelope (KeyError) is a class. The actual envelope you were handed is an object (also called an instance) of that class.
Why the topic needs this: when the parent writes except KeyError, the word KeyError is a class (the cutter). The thing that was actually raised is an object (a cookie). Catching works by asking "is this cookie shaped like this cutter, or like one of its parent cutters?"
3. Inheritance — cutters made from other cutters
This is the single most important prerequisite, so build it slowly.
The magic phrase to memorise is "is-a". A KeyError is-a LookupError. A LookupError is-a Exception. An Exception is-a BaseException.

Read the arrows as "is-a", always pointing from the more specific thing up to the more general thing.
Why the topic needs this: the parent note's entire tree (BaseException → Exception → LookupError → KeyError) is nothing but a chain of "is-a" relationships. Learn more about the general mechanism in 2.1.04-Inheritance — here we only use it in one direction: every exception is-a BaseException.
4. The tree, drawn as a picture
Because "is-a" links stack up, they form a tree: one root at the top, branches splitting downward into ever-more-specific errors.

Why the topic needs this: catching a parent catches all its descendants. except LookupError grabs both KeyError and IndexError because they are its descendants. This one fact powers the multi-lookup handler in the parent note.
5. try / except — reading the notation
Now the syntax the parent uses everywhere.
Why the topic needs this: the parent's "Python walks up the hierarchy" is really two upward walks happening together — it climbs the call stack (which function is watching) and, at each watcher, checks the type tree (does this cutter match?). Keep them separate in your head, but note they point the same way.
Deeper mechanics of try/except/finally live in 1.3.06-TryExcept-Finally.
6. Matching rule — how except decides
Two names appear in the rule below, so meet them first:
That is the whole engine. Everything the parent says about "specific before general" follows from combining this rule with one extra fact: Python reads except clauses top to bottom and stops at the first match.

7. Two more except shapes you must recognise
The parent uses only single-type clauses, but two related forms appear constantly in real code — and both obey the same matching rule from Section 6.
8. Numbers and notation you'll meet
The parent note uses two things a 12-year-old may not have seen: scientific notation and a made-up "specificity" fraction.
Why the topic needs this: it turns the vague advice "be specific" into something you can see — a fraction close to 1 is surgical, a fraction near 0 is a shotgun.
Prerequisite map
The picture below shows how each foundation feeds the next; the arrows read "is needed before". You do not need to know the diagramming syntax — just follow the arrows left-to-top-right.

Once these are solid, move on to 1.3.08-Custom-Exceptions (make your own tree nodes), 1.3.09-Context-Managers (the with statement for safe cleanup), and 3.2.05-Logging (recording caught exceptions).
Equipment checklist
Cover the right side and answer aloud. If any line stumps you, re-read its section.
An exception is fundamentally a
Difference between a class and an object
KeyError); object = one actual instance (KeyError('age'))."Inheritance" in one phrase
Is a KeyError a LookupError?
LookupError is an ancestor of KeyError, so issubclass(KeyError, LookupError) is True.Ancestor vs. sibling
What except LookupError catches
LookupError and every descendant — including both KeyError and IndexError.The exact matching rule
except Net catches the culprit iff isinstance(culprit, Net) — i.e. Net is the culprit's class or an ancestor of it.Which direction does a raised exception travel?
What does except (IndexError, KeyError): mean?
Why is bare except: dangerous?
except BaseException, so it also swallows SystemExit, KeyboardInterrupt and GeneratorExit — Ctrl+C and shutdown stop working; use except Exception instead.Why the general handler must come last
except clauses top-to-bottom and stops at the first match; a parent above a child makes the child unreachable dead code.What 1e308 means
Recall Self-test: order these clauses correctly
Given KeyError, LookupError, Exception, put them in valid except order and say why.
Answer ::: KeyError (most specific) → LookupError (its parent) → Exception (its grandparent). Specific-before-general so no clause is shadowed by an ancestor above it.