Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 71)
71.
What does the __call__ method do in a Python class?
It calls the constructor of the class.
It calls the destructor of the class.
It allows an instance of the class to be called as a function.
It checks if an instance is callable.
Answer: Option
Explanation:
The __call__ method in a Python class allows an instance of the class to be called as if it were a function.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.