Lesson 1 · OKSTEM College · Associate of Science in Computer Science
Classes, Objects & Constructors
A class is a blueprint; an object is a concrete instance created from that blueprint. Python's __init__ method is the constructor — it runs automatically when a new object is created.
Every method's first parameter is self — a reference to the instance. Python passes it automatically; you never pass it explicitly when calling a method.
Knowledge Check
The __init__ method is called
'self' in a Python method refers to
Instance variables are set on
Which method controls how an object is displayed with repr()?