Commit e277ba41 by BellCodeEditor

save project

parent ffa053dc
Showing with 7 additions and 2 deletions
...@@ -5,6 +5,11 @@ class Hero: ...@@ -5,6 +5,11 @@ class Hero:
self.attack=attack self.attack=attack
houyi=Hero("后羿",250,23) houyi=Hero("后羿",250,23)
yase=Hero("亚瑟",300,20) yase=Hero("亚瑟",300,20)
print("后羿的血量为"houyi.hp) def upgrade():
print("亚瑟的血量为"yase.hp) houyi.hp=houyi.hp+50
houyi.attack=houyi.attack+4
upgrade()
upgrade()
print("后羿的血量为",houyi.hp)
print("亚瑟的血量为",yase.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