Lesson 1: Errors and exceptions, reading them and catching them
15 min read·14 Oct 2026
Module 8 · Lesson 1 · About 50 minutes · Needs: Modules 1 to 7 (loops, dictionaries, functions, datetime dates)The situation
Amira wants the real files loaded: forty loans, a line each. "If one line is wrong, tell me which one. Don't just stop." Until now, one bad value has stopped your whole cell. With forty lines, and Tom's notebook to come, that will not do.
This lesson follows one line from loans.csv, Ben's loan L13: L13,B20,M02,2026-09-21,. Read correctly, it gives a borrow date of 21 September, 9 days late today, 180 pence owed. Typed the way Tom types dates, 21/09/2026, it stops the program. You will learn to read that stop, catch it, and raise your own.