Lesson 1: Classes, your own kinds of object
17 min read·14 Oct 2026
Module 9 · Lesson 1 · About 50 minutes · Needs: Module 6 (functions, parameters), Module 7 (imports, thebooknookpackage,date), Module 3 f-strings
The situation
Amira wants lending and returning done properly. "When Jonah's Frankenstein is out, I want the program to know it is out, know it is his, and know what he owes, without you looking anything up."
Right now a loan is a dictionary, and its rules are loose functions in booknook/dates.py and booknook/fees.py. This lesson builds your own kinds of value, Book, Member and Loan, that carry their data and rules together. Jonah's loan L04, Frankenstein, borrowed Monday 14 September 2026, 16 days late today and capped at 300 pence, runs through the lesson.