What is the output of the following code ?
class A: def __init__(self): print("__init__ is called ") def __call__(self, *args, **kwargs): print("__call__ is called") a = A() a()
__init__ is called __call__ is called
__call__ is called __init__ is called
__init__ is called Traceback (most recent call last): File "C:/pythoneasy/test1.py", line 7, in <module> a() TypeError: 'A' object is not callable
__init__ is called
A() invokes __init__() method and a() invokes __call__() method
Note : a() will raise error if __call__() is not definedinside the classs
Comment here: