English

What is the purpose of the Destructor?

Advertisements
Advertisements

Question

What is the purpose of the Destructor?

Short/Brief Note
Advertisements

Solution

Destructor is also a special method that gets executed automatically when an object exit from the scope. It is just the opposite of the constructor. In Python, _del_( ) method is used as the destructor.

shaalaa.com
Constructor and Destructor in Python
  Is there an error in this question or solution?
Chapter 10: Python Classes and objects - Evaluation [Page 187]
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×