Lesson 3: Special methods: objects that print, compare and add
16 min read·14 Oct 2026
Module 9 · Lesson 3 · About 50 minutes · Needs: Module 9 Lessons 1 and 2 (classes,__init__,self, methods), Module 8 Lesson 1 (raising an error), Module 3 Lesson 3 (f-strings)
The situation
Amira prints the books that are out and gets <booknook.models.Book object at 0x...>. "I cannot read that," she says. "And why are two records of Frankenstein different books?"
Your classes hold the right data, but Python does not know how to show, compare or count them. This lesson teaches them print, ==, <, len, in, for and +. Jonah's Frankenstein, B06, on loan as L04 and 16 days late today, runs through the lesson.