What is the name of the constructor-like method in a Python class?
-
A
__new__ only
-
B
constructor
-
C
__start__
-
D
__init__
Correct answer
Correct answer
D. __init__
5 views
Explanation
__init__ initialises a newly created instance.
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ