here is my code
class third:
def __init__(self):
print("Cons is called")
def __del__(self):
print("desc is called")
def setName(self,firstName,lastName):
self.firstName=firstName;
self.lastName=lastName;
def displayName(self):
print(self.firstName,' ' ,self.lastName)
ob=third();
ob.setName('gaurav','sharma');
ob.displayName()
ob.__del__()
ob.displayName();
and output is
Cons is called
gaurav sharma
desc is called
gaurav sharma
desc is called
i have destroyed object by using del and then tried to call displayname function again still it is providing distroyed values and now i m confused weather the object is destroid or not.