How is __init__() different from __del__() ?
__init__() is the class constructor or initialization method which is automatically invoked when we create a new instance of a class.
__del__() is a destructor which is automatically invoked when an object (instance) goes out of scope.
For Example:
class Sample:
def __init__(self):
self.data = 79
print('Data:',self.data,'created')
def __del__(self):
print('Data:',self.data,'deleted')
s = Sample()
del s