会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
若兮ruoxi
博客园
首页
新随笔
联系
管理
订阅
2018年8月24日
面向对象组合及三大特性
摘要: 组合 在一个类中以另外一个类的对象作为数据属性,称为类的组合 1 class Role: 2 def __init__(self, name, hp, ad): 3 self.name = name 4 self.hp = hp 5 self.ad = ad 6 def attack(self):
阅读全文
posted @ 2018-08-24 16:55 若兮ruoxi
阅读(233)
评论(0)
推荐(0)
编辑
公告