inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

taeho7702님의 게시글

taeho7702 taeho7702

@taeho77028354

수강평 작성수
2
평균평점
5.0

게시글 2

질문&답변

__del__ 작동 여부

실행 결과는 True this car deleted this car deleted 입니다

좋아요수
1
댓글수
4
조회수
358

질문&답변

__del__ 작동 여부

class Tesla(object): def __init__(self, owner, color): self.owner = owner self.color = color def __str__(self): return f"{self.color} color {self.owner}'s car" def __len__(self): return len(self.owner) def __del__(self): print("this car deleted") def __eq__(self, other): return self.color == other.color tesla = Tesla("A", "Yellow") tesla1 = Tesla("B", "Yellow") print(tesla == tesla1)

좋아요수
1
댓글수
4
조회수
358