Python 零基础新手入门 #10 Class (类别)

哇库哇库
1.Class类 相关概念
papaya老师讲的很形象
更多资料参考:
https://www.runoob.com/python3/python3-class.html
术语:
类
属性
方法
属性引用
实例化
构造方法
2.实例:回合制游戏
1.战士 和 魔物 都继承 游戏角色(class)
2.游戏角色(class) 内含 防御 方法(method)
3.编写战士和魔物的 攻击 方法(method)
4.添加佐料 随机数(random.choice)
Note : 构造方法不要误写成 __int__(self,xx)