Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Define Constructor in Python.
Answer:

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
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook