Commit 39d291f9 by BellCodeEditor

save project

parent 78acfc3a
Showing with 9 additions and 10 deletions
......@@ -4,18 +4,16 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def ungrade():
yeas.level=yase.lelve+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
def upgrade():
yase.level+=1
yase.hp+=50
yase.attack+=4
yase=Hero('yase',300,20)
houyi=Hero('houyi',240,23)
k=Hero('K',5600,199)
print("亚瑟的等级为",yase.level)
print("后羿的等级为",houyi.level)
print("亚瑟的血量为",yase.hp)
print("后羿的血量为",houyi.hp)
print("亚瑟的攻击力为",yase.attack)
print("后羿的攻击力为",houyi.attack)
print("亚瑟的初始血量为",yase.hp)
upgrade()
upgrade()
print("升级2次后,亚瑟的血量为",yase.hp)
print(k.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