Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 56)
56.
What is the purpose of the __subclasses__() method in Python classes?
To define class attributes
To create a new instance of the class
To retrieve a list of all direct subclasses of a class
To access superclass attributes directly
Answer: Option
Explanation:
The __subclasses__() method is used to retrieve a list of all direct subclasses of a class.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.