Commit d4605018 by BellCodeEditor

save project

parent b8f3b905
Showing with 12 additions and 3 deletions
......@@ -4,9 +4,18 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack
yase=Hero('yase',3000,20)
houyi=Hero('houyi',1500,30)
yao=Hero('yao',2500,15)
print("亚瑟的血量为: ",yase.hp)
print("后羿的血量为: ",yase.hp)
print("瑶的血量为: ",yase.hp)
upgrade()
upgrade()
print("升级两级后,亚瑟的血量为: ",yase.hp)
print("升级两级后,后羿的血量为: ",houyi.hp)
print("升级两级后,瑶的血量为: ",yao.hp)
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