Commit e572c18c by BellCodeEditor

auto save

parent 12e44b3b
Showing with 13 additions and 11 deletions
#定义一个英雄类(Hero)
class Hero:
#定义init方法
def __init__(self):
#定义属性值(level=1,hp=300,attack=20)
self.level=1
self.hp=300
self.attack=20
#实例对象yase
yase=Hero()
def __init__(self,?,?,?):
#定义属性值(name,level=1,hp=300,attack=20)
?
?
?
?
#实例对象yase,houyi
yase=Hero(?,?,?)
houyi=?
#打印yase的血量hp
print('亚瑟的血量为:'+str(yase.hp))
#打印yase的攻击力attack
print('亚瑟的攻击力为:'+str(yase.attack))
\ No newline at end of file
print('亚瑟的血量为:'+)
#打印houyi的血量hp
print('后裔的血量为:'+)
\ 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