Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 95)
95.
What is the purpose of the __call__() method in a Python class?
To create a new instance of the class
To define class attributes for the class
To customize the behavior when an instance of the class is called
To access superclass attributes directly
Answer: Option
Explanation:
The __call__() method in a class is used to customize the behavior when an instance of the class is called, allowing instances to be callable.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.