Question OOP-CTOR-0006
EasyIn Python, which method acts as the constructor that initialises a new object?
- A.
str
- B.
del
- C.
Show answer and explanation
Answer: C
init initialises the object after new has created it.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Constructors and Destructors question
In Python, which method acts as the constructor that initialises a new object?
str
del
Answer: C
init initialises the object after new has created it.
init
new only