Commit fe8bc681 by BellCodeEditor

save project

parent 8a162664
Showing with 8 additions and 6 deletions
......@@ -4,11 +4,13 @@ class Hero:
self.name=name
self.HP=HP
self.attack=attack
yase=Hero("亚瑟",99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999,999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)
def upgrade():
def upgrade():
yase.level=yase.level+1
yase.HP=yase.HP+100
yase.attack=yase.attack+3
upgrade()
upgrade()
print("亚瑟升级后的血量:",yase.HP)
\ No newline at end of file
houyi=Hero("后羿",300,40)
houyi=upgrade()
print("后羿升级后的血量:",houyi.HP)
print("后羿升级后的攻击力:",houyi.attack)
print("后羿升级后的等级:",houyi.level)
\ 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