Lab: Five shelf functions, each checked with assert
Module 6 · Lab · About 50 minutes · Needs: lessons 1 to 3 of this module, and Module 5 (lists, dictionaries, comprehensions)
What you are building
Amira's question for this module is "I want the same answer every time." The three lessons built the shelf's rules as functions, but each lesson wrote them a little differently. This lab settles them: one final version of each of the five functions the rest of the course uses, due_date, is_overdue, days_late, late_fee and reminder_text, each proved with assert against answers you already know.
Then you run all twelve loans of the course's slice through them. The four overdue loans must owe 580 pence, the same figure every module reaches. In Module 7 these five functions move, unchanged in meaning, into the booknook package.
Open a new Colab notebook, call it module-06-lab.ipynb, and run each cell in order.