🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python OOP: all 15 questions

Quiz: Python OOP · Question 2 of 15

When does init run?

When does __init__ run?

  1. A.When the class is defined
  2. B.Every time a new object is created
  3. C.When the program ends
  4. 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 →