← Quiz: Python OOP: all 15 questions
Quiz: Python OOP · Question 2 of 15
When does init run?
When does __init__ run?
- A.When the class is defined
- B.Every time a new object is created
- C.When the program ends
- D.Only when called directly
Answer & explanation
Correct answer: Every time a new object is created
init is the constructor — it runs automatically when you create an object.
Can you get the rest right without peeking?
Take the timed Quiz: Python OOP quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →