Commit 8890443a by BellCodeEditor

auto save

parent bacb4173
Showing with 12 additions and 5 deletions
...@@ -5,11 +5,17 @@ class Hero: ...@@ -5,11 +5,17 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def erty(): def erty(self):
yase.level=yase.level+1 self.level=self.level+1
yase.hp=yase.hp+55 self.hp=self.hp+55
yase.attack=yase.attack+7 self.attack=self.attack+7
yase = Hero("亚瑟",100,20) yase = Hero("亚瑟",100,20)
erty() Him = Hero("Him",200,40)
shidifu =Hero("史蒂夫",102,24)
yase.erty()
Him.erty()
shidifu.erty()
print("亚瑟的血量",yase.hp) print("亚瑟的血量",yase.hp)
print("Him的血量",Him.hp)
print("史蒂夫的血量",shidifu.hp)
\ 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