Five postmortems — three public, two composite — and the one fix that would have caught all of them — step 9 of 9
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Final drill. You have five postmortem records from the inbox. Each
one already carries a class field (1-4) and a severity field
(1-10, where 10 is "front-page lawsuit").
Write triage_failures(cases) that returns a dict with two keys,
in this exact order:
counts: a dict mapping class number (int) to count (int), with keys inserted in ascending class order (1, 2, 3, 4). Classes with zero count are omitted.urgent: thename(str) of the case with the highest severity. On a tie, return the FIRST one encountered (stable order).
Five cases run for you. Expected output:
{'counts': {1: 1, 2: 1, 3: 2, 4: 1}, 'urgent': 'air_canada'}
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Final drill. You have five postmortem records from the inbox. Each
one already carries a class field (1-4) and a severity field
(1-10, where 10 is "front-page lawsuit").
Write triage_failures(cases) that returns a dict with two keys,
in this exact order:
counts: a dict mapping class number (int) to count (int), with keys inserted in ascending class order (1, 2, 3, 4). Classes with zero count are omitted.urgent: thename(str) of the case with the highest severity. On a tie, return the FIRST one encountered (stable order).
Five cases run for you. Expected output:
{'counts': {1: 1, 2: 1, 3: 2, 4: 1}, 'urgent': 'air_canada'}
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.