CONSTRUCTOR: Constructors logics are executed only when object is created. Ex-1: class Myclass(): def __init__(self): print(“Hi”) def wish (self): print(“Hello”) c=Myclass() #Hi c.wish() #Hello
CONSTRUCTOR: Constructors logics are executed only when object is created. Ex-1: class Myclass(): def __init__(self): print(“Hi”) def wish (self): print(“Hello”) c=Myclass() #Hi c.wish() #Hello