culTest

    One of the 50 questions in this topic

    How much do you know about Python?

    What special method is automatically executed when a class is instantiated?

    Answers

    __new__()
    __init__()Correct
    __call__()
    __create__()

    __init__() is the constructor method that is automatically executed when creating a class instance, used to initialize attributes. Unlike __new__() (which actually creates the instance and is rarely overwritten), __init__() receives the already created instance (self) and sets its initial state. It should not return any value except None. It is one of the many special or 'dunder' (double underscore) methods in Python.