Created
February 2, 2017 19:27
-
-
Save kizmo04/1705edba9470411cde63c9ecfa4fcd12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Recipes: | |
""" | |
재료를 활용해 조리법에 맞게 요리를 만들자 | |
""" | |
description = '레시피를 활용해 음식을 만들자' | |
prepare = '손을 깨끗이 씼어요' | |
display = '원형 접시에 담을겁니다' | |
def __init__(self, ingredient, food): | |
self.__ingredient = ingredient | |
self.food = food | |
@property | |
def aaa(self): | |
return self.__ingredient | |
@aaa.setter | |
def ppp(self, a): | |
self.__ingredient = a | |
def with_pan(self): | |
""" | |
ingredient에 할당된 재료를 팬에 넣고 구우면 | |
food에 할당된 음식이 완성된다는 문장을 리턴 | |
:return: 스팸을 팬에 넣고 구우면 스팸구이 완성! | |
""" | |
return '{}을 팬에 넣고 구우면 {}완성!'.format(self.aaa, self.food) | |
egg = Recipes('계란', '계란후라이') | |
print(egg.with_pan()) | |
egg.ppp = '달걀' | |
print(egg.with_pan()) | |
print(type(egg.with_pan)) | |
print(type(egg.ppp)) | |
print(type(egg.aaa)) | |
print(type(egg.food)) | |
print(egg.ppp) | |
print(egg.aaa) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Property와 @.setter가 궁금해서 함수 이름을 바꿔봤는데요, 데코레이터를 붙였더니