Parameterized Constructor: Parameterized constructors are the constructors which accept the arguments at the time of object creation of a class. This type of constructors are called parameterized constructors. The value we pass to the constructor at the time of object creation is used for the initialization of instance variable.
Syntax:
Example 2: Example elaborating the parameterized constructor.
#Parameterized Constructor class Test: def __init__(self,y,z): print("Sum of Number is: "+str(y+z)) # c1 = Test() c2 = Test(23,34) #Output #Sum of Number is: 57