Commit bf26475b by BellCodeEditor

save project

parent 659361be
Showing with 5 additions and 0 deletions
...@@ -5,6 +5,11 @@ class Hero: ...@@ -5,6 +5,11 @@ class Hero:
self.hp= hp self.hp= hp
self.attack= attack self.attack= attack
def upgrade(self):
self.level=self.level+1
self.hp = self.hp + 50
self.attack = self.attack + 4
yase = Hero("去",300,20) yase = Hero("去",300,20)
houyi = Hero("我",240,23) houyi = Hero("我",240,23)
print("去为:",yase.hp) 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