python #oop #객체지향 #파이썬1 파이썬 OOP(Object Oriented Programming)객체지향 test test1 from future.backports.xmlrpc.client import boolean class Animal: # print("생성자") def __init__(self): self.flag_sound = True #메소드 def bbeonguri(self): self.flag_sound = False # 메모리에서 사라질떄 호출됨 def __dal__(self): # print("소멸자") pass # toSting과 같음 def __str__(self): return "소리능력" + str(self.flag_sound) # if __name__ == '__main__': # a = Animal() # print(a.flag_sound) # a.bbeonguri() # print(a.f.. 2023. 6. 23. 이전 1 다음