Python Programming - Objects - Discussion

Discussion Forum : Objects - General Questions (Q.No. 14)
14.
In Python, what is the purpose of the __del__ method in a class?
To create a new instance of the class
To destroy the class object
To define class attributes
To delete a specific attribute
Answer: Option
Explanation:
The __del__ method is called when an object is about to be destroyed. It can be used to perform cleanup operations before the object is deleted.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.