Commit 99c773fe by BellCodeEditor

save project

parent 90755c29
Showing with 9 additions and 4 deletions
class Hero:
def __init__(self,hp,attack):
def __init__(self,name,hp,attack):
self.level = 1
self.hp=hp
self.attack=attack
yase = Hero("亚瑟",300,20)
print("亚瑟的初始血量为:",yase.hp)
def upd( ):
yase.hp+=50
upd()
upd()
print("神级2次后,亚瑟的血量值为:",yase.hp)
yase = Hero(2,300)
print("yase的血量值为:",yase.hp)
print("yase的攻击力为:",yase.attack)
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