Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 21)
21.
In Python, what is the purpose of the __init_subclass__() method?
To initialize the attributes of a subclass
To create a new instance of a subclass
To initialize attributes common to all subclasses
To customize the creation of subclasses
Answer: Option
Explanation:
The __init_subclass__() method is called when a new subclass is created, allowing customization of the creation process.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.