python class destroying

Solutions on MaxInterview for python class destroying by the best coders in the world

showing results for - "python class destroying"
Sofia
13 Jun 2016
1class animal:
2  def __init__(self,name):
3    self.Name = name
4  def __del__(self):
5    print(self.Name+" has died D:")
6    
7ben = animal("Ben")
8def deleteObj(obj):
9  del obj
10  
11deleteObj(ben)