Bundle data and behavior together
← Back to ArchitectureA class is a blueprint. An object is a thing built from that blueprint. One "Dog" blueprint can make many dogs — each with its own name, but all able to bark.
This idea is called Object-Oriented Programming (OOP). It lets you bundle data (a dog's name) and behavior (barking) into one neat package.
__init__ is the constructor — it runs when you create an object.self means "this particular object."An object keeps its data inside and lets you change it through methods. This protects the data from invalid changes.
A class can inherit from another, reusing its code and adding more. A Puppy is a Dog that can also play.
__init__ sets up attributes; self is "this object."