Commit 0544c1ce by BellCodeEditor

save project

parent 0ad77f6e
Showing with 10 additions and 4 deletions
...@@ -4,7 +4,13 @@ class Hero: ...@@ -4,7 +4,13 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('亚瑟',300,20) def up1(self):
houyi=Hero('后羿',240,23) self.level=self.level+1
print("亚瑟的血量为:",yase.hp) self.hp=self.hp+100
print("后羿的血量为:",houyi.hp) self.attack=self.attack+10
yase=Hero('末影龙',200,15)
houyi=Hero('凋灵',600,12)
yase.up1()
print("末影龙的血量为:",yase.hp)
print("末影龙的攻击为:",yase.attack)
print("末影龙的等级为:",yase.level)
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