PYTHON INTERMEDIATEChapter 8 · Objects and Classes
Object-oriented programming
Python supports Object-Oriented Programming (OOP). Define a class using class, and initialize fields inside __init__(self).
Worked example
How it reads
- def __init__(self, name) defines the constructor method
- self refers to the specific instance of the object class

Cloud tip: Methods must receive self as their first parameter to access object fields.


