Q. What is the purpose of `__init__` method in Python classes?

  • (A) It is a destructor
  • (B) It initializes the object
  • (C) It is a static method
  • (D) It defines class name
πŸ’¬ Discuss
βœ… Correct Answer: (B) It initializes the object
Explanation: `__init__` is the constructor method called when a new object is created.
Explanation by: Mr. Dubey
`__init__` is the constructor method called when a new object is created.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
78
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
98%
Success Rate