Answers for "python __class__"

0

python __class__

brightness_4
class Example: 
    def __init__(self): 
        print("Instance Created") 
      
    # Defining __call__ method 
    def __call__(self): 
        print("Instance is called via special method") 
  
# Instance created 
e = Example() 
  
# __call__ method will be called 
e()
Posted by: Guest on February-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language