摘要: class pers(): def __init__(self,hp): self._hp=hp @property def hp(self): return self._hp @hp.setter def hp(self,hp): self._hp=gp if hp>=0 else 0 a=per 阅读全文
posted @ 2024-01-27 16:09 Kazuma_124 阅读(15) 评论(0) 推荐(0) 编辑
摘要: class test(): aaa = 111 bbb = 222 ccc = 333 @classmethod def cm(cls): cls.aaa="***" def im(self): self.aaa="iii" aa = test() print(aa.aaa,aa.bbb,aa.cc 阅读全文
posted @ 2024-01-27 15:11 Kazuma_124 阅读(18) 评论(0) 推荐(0) 编辑