A

Admin • 833K Points
Coach

Q. What is the purpose of `__del__()` method in Python?

  • (A) To construct an object
  • (B) To define a class method
  • (C) To represent string output
  • (D) To perform clean-up before object is deleted
  • Correct Answer - Option(D)
  • Views: 27
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

`__del__()` is the destructor in Python, called when the object is about to be destroyed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.