Commit 61415b90 by BellCodeEditor

save project

parent f47689a4
Showing with 10 additions and 0 deletions
class Hero:#创建一个类Hero
def __init__(self):#定义
self.level=1#设置等级
self.hp=300#设置血量
self.attack=20#设置攻击力
yase=Hero()#实例化对象yase
print(yase.level)#打印等级
print(yase.hp)#打印血量
print(yase.attack)#打印攻击力
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment