# Python program to illustrate destructor
class Employee:
# Initializing
def __init__(self):
print('Employee created.')
# Deleting (Calling destructor)
def __del__(self):
print('Destructor called, Employee deleted.')
obj = Employee()
Employee created.
obj
<main.Employee at 0x7b48848>
del obj
obj
NameError: name ‘obj’ is not defined