A class describes what every Dog is like; an object is one actual dog, built from the blueprint and carrying its own data.
1 Blueprints, Not Things
class Dog: stores a description; Dog("Rex") builds one real object from it.
2 __init__ Sets Up
Creating an object automatically runs __init__, which stores the starting attributes.
3 self = This Object
Inside methods, self is whichever object the call went through — rex or bella.
4 Objects Hold State
Attributes live on the object, so two Dogs can carry different names side by side.
Blueprints and the things they build
Blueprints, Not Things1class Dog: stores a description; Dog("Rex") builds one real object from it. __init__ Sets Up2Creating an object automatically runs __init__, which stores the starting attributes. self = This Object3Inside methods, self is whichever object the call went through — rex or bella. Objects Hold State4Attributes live on the object, so two Dogs can carry different names side by side. 4 building blocks make up Blueprints and the things they build
Watch Dog("Rex") trigger __init__, watch attributes attach to the object — then change one.
mainclass Dog: stores the blueprint — nothing inside runs until an object is created.
Memory
no variables yet — press play
Console
output appears as the program runs…
Each Dog object carries its attributes in its own slots — changing rex leaves every other dog alone.
Drag to orbit the scene. Press Play to watch memory in action.
From the line rex = Dog("Rex") to a ready object: look up the class, make it, set it up.
process decision input / output start / end Click a term, then click its description to lock the pair.
5 conceptsTap a card to expand ?class Dog:drops into place
?__init__(self, ...)drops into place
?selfdrops into place
?rex.namedrops into place
?Dog("Rex")drops into place
Two robots, one drained battery — which one changes?
Your predicted output — one line per console line
Hint: Each Robot(...) call runs __init__ fresh, so bot2 starts with battery 3 — draining bot changed only bot.
01class Dog: defines a blueprint; Dog("Rex") builds one object from it.
02__init__ runs automatically at creation and stores starting attributes via self.
03self is the object itself — every method receives it as the first parameter.
04Attributes live on the object: rex.name and rex.sound belong to rex alone.
05Objects are mutable — rex.sound = "WOOF" updates that one object only.