Answers for "python class destroying"

0

python class destroying

class animal:
  def __init__(self,name):
    self.Name = name
  def __del__(self):
    print(self.Name+" has died D:")
    
ben = animal("Ben")
def deleteObj(obj):
  del obj
  
deleteObj(ben)
Posted by: Guest on March-10-2020

Code answers related to "python class destroying"

Python Answers by Framework

Browse Popular Code Answers by Language