Commit a6889bed by BellCodeEditor

save project

parent 19f95898
Showing with 9 additions and 4 deletions
......@@ -5,6 +5,12 @@ class Hero:
self.hp=hp
self.attack=attack
yase=Hero("垭瑟",300,20)
houyi=Hero("后羿",250,23)
print("姓名:",yase.name,"血量:",yase.hp,"攻击力:",yase.attack)
print("姓名:",houyi.name,"血量:",houyi.hp,"攻击力:",houyi.attack)
\ No newline at end of file
print("垭瑟血量:"yase.hp)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
upgrade()
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