__str__1 __str__ Method 출처 : https://www.pythontutorial.net/python-oop/python-__str__/ Introduction to the Python __str__ method class Person: def __init__(self, first_name, last_name, age): self.first_name = first_name self.last_name = last_name self.age = age person = Person('John', 'Doe', 25) print(person) # print(Person) # print() 함수를 사용하여 Person 클래스의 인스턴스를 표시하는 경우 print() 함수는 해당 인스턴스의 메모리 주소를 표시합니다. 때로는 클래스 인스턴스의 .. 2023. 4. 3. 이전 1 다음