摘要:
class A: __role = 'CHINA' @classmethod def show_role(cls): print(cls.__role) @staticmethod def get_role(): return A.__role @property def role(self): r 阅读全文
posted @ 2019-11-13 16:37
Test-Billy
阅读(100)
评论(0)
推荐(0)
摘要:
@property class Goods: def __init__(self): # 原价 self.original_price = 100 # 折扣 self.discount = 0.8 @property def price(self): # 实际价格 = 原价 * 折扣 new_pri 阅读全文
posted @ 2019-11-13 16:26
Test-Billy
阅读(215)
评论(0)
推荐(0)
浙公网安备 33010602011771号