会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
智礝
博客园
首页
新随笔
联系
订阅
管理
2019年11月
python(拍儿婶)的bug之私有变量
摘要: class A: hobby = "我喜欢你" def __init__(self, name, sex): self.name = name self.sex = sex self.__age = 18 # 听说你是A一个人的 print(self.__age)class B(A): passa1
阅读全文
posted @ 2019-11-12 15:32 智礝
阅读(121)
评论(0)
推荐(0)
2019年10月
python对象的属性引用另一个类的
摘要: class GameRole: def __init__(self, name, ad, hp): self.name = name self.ad = ad self.hp = hp def attack(self, p): p.hp = p.hp - self.ad if p.hp > 0: p
阅读全文
posted @ 2019-10-26 11:58 智礝
阅读(1526)
评论(0)
推荐(0)
公告