Commit fcd43592 by BellCodeEditor

auto save

parent 3f9c2da4
Showing with 6 additions and 5 deletions
...@@ -3,13 +3,13 @@ class Hero: ...@@ -3,13 +3,13 @@ class Hero:
self.level=1 self.level=1
self.Hp=Hp self.Hp=Hp
self.attack=attack self.attack=attack
def shengji(self):
self.level = self.level + 1
self.Hp = self.Hp + 3
self.attack = self.attack + 1
wen= Hero("温",500,30) wen= Hero("温",500,30)
xu= Hero("絮",500,20) xu= Hero("絮",500,20)
print("温的血量",wen.Hp) print("温的血量",wen.Hp)
print("絮的血量",xu.Hp) print("絮的血量",xu.Hp)
def shengji(: wen.shengji()
yase.level = yase.level + 1
yase.Hp = yase.Hp + 3
yase.attack = yase.attack + 1
shengji()
print("温的初始血量:",wen.Hp) print("温的初始血量:",wen.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