Commit c7a0df5d by BellCodeEditor

save project

parent d936ab5f
Showing with 8 additions and 2 deletions
...@@ -5,8 +5,13 @@ class Hero: ...@@ -5,8 +5,13 @@ class Hero:
self.hp= hp self.hp= hp
self.attack= attack self.attack= attack
yase = Hero("亚瑟",300,20) def upgrade():
houyi= Hero("后羿",240,23) yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
yase = Hero("亚瑟",300,20)
print("亚瑟的初始血")
print("yase的血量值为:",yase.hp) print("yase的血量值为:",yase.hp)
print("yase的攻击力为:",yase.attack) print("yase的攻击力为:",yase.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