Commit dee6b441 by BellCodeEditor

save project

parent 9ccc8208
Showing with 10 additions and 3 deletions
...@@ -4,7 +4,14 @@ class Hero: ...@@ -4,7 +4,14 @@ class Hero:
self.name=name self.name=name
self.hp self.hp
self.attack self.attack
def upgrade():
yase.level=yase.levle=1
yase.hp=yase.hp=50
yase.attack=yase.attack=4
yase=Hero("亚瑟",300,20) yase=Hero("亚瑟",300,20)
houyi=Hero("后裔",240,23) houyi=Hero("亚瑟初始血量",yase.hp)
print("亚瑟的血量",yase.hp) upgrade
print("后裔的血量",houyi.hp) upgrade
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