0 votes
in Python by
Define Constructor in Python?

1 Answer

0 votes
by

Constructor is a special type of method with a block of code to initialize the state of instance members of the class. A constructor is called only when the instance of the object is created. It is also used to verify that they are sufficient resources for objects to perform a specific task.

There are two types of constructors in Python, and they are:

Parameterized constructor

Non-parameterized constructor

Related questions

+1 vote
asked Jan 11, 2021 in Python by SakshiSharma
0 votes
asked May 23, 2020 in Python by sharadyadav1986
...