Lab: Lend and return books with classes
Module 9 · Lab · About 60 minutes · Needs: lessons 1 to 4 of this module, and the Module 8 lab (thebooknookfolder in your Drive, withstorage.py)
What you are building
Amira's request for this module is "Lend and return books properly." The four lessons built the parts: classes with __init__ and methods (Lesson 1), a Library that holds the books and refuses a fourth loan (Lesson 2), objects that print, compare and sort (Lesson 3), and dataclasses with type hints (Lesson 4).
This lab joins them into the project's new module, booknook/models.py, with the four names the course fixed: Book, Member and Loan as dataclasses, and Library, a plain class that guards the rules. The library is built from storage.py's three loaders, so it starts from the real files: 9 of 27 copies out, 4 loans overdue, 580 pence owed. Then it lends and takes back books at the counter.
Open a new Colab notebook, call it module-09-lab.ipynb, and run each cell in order.