1. construct()
  2.  ___init___()
  3.  ___str___
  4. function whose name is similar to class name
4 views

1 Answers

Option 2 :  ___init___()

The correct answer is  ___init___()

  • Constructors are generally used for instantiating an object. The task of constructors is to initialize(assign values) to the data members of the class when an object of a class is created.
  • In Python, the __init__() method is called the constructor and is always called when an object is created.
4 views

Related Questions