Caffeinated Coder
Book an appointment
Lesson 28 · Designing code

Objects and classes

A class is a blueprint and objects are the things you build from it, each with its own data. Step through a small BankAccount class in Python: build two accounts with __init__, call methods on them, see why the balance is changed only through methods, then make a Savings subclass that reuses and overrides code, and a Bank that has accounts instead of being one.

12 min10 steps5 questionsIntermediate
Fig 28 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.