The barangay office asked for five figures from its files, and someone wrote a short script to give them. It stops with an error, and once that is fixed it gives four wrong figures out of five, without a word. The office worked the figures out by hand, so you know what the script should say.
Each figure comes from a function with one mistake from modules 2 to 6: a column name the file doesn’t have, numbers compared as text, a function using a name it was not given, an except that hides a misspelt name, and a yes-or-no column where "no" counts as true. As in the first drill, you predict, trace, fix and explain each one, and each check starts red. On the way, a short example shows why every file in the course is opened with encoding="utf-8".
Its notebooks
Section titled “Its notebooks”- 55_debugging_drill.ipynbDebugging drill: a report that goes wrongRead itCompanion · 5 exercises
The notebooks are in your course folder; here you can read them without running anything.