Python __init__ Method
Multiple Choice Easy
Question
When is `__init__` called in a Python class?
Hint
__init__ is the initializer / constructor.
Explanation
__init__ is called automatically when you create a new instance of a class (e.g., obj = MyClass()). It initializes the object's attributes. It is the Python equivalent of a constructor in other languages.
Related Resources
Related Lessons
- Classes and Objects
The __init__ method.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.