Commit 27a3307b by BellCodeEditor

save project

parent 2fde27f4
Showing with 4 additions and 4 deletions
...@@ -5,12 +5,12 @@ class Hero: ...@@ -5,12 +5,12 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrad(self): def upgrad(self):
self.level=level+1 self.level=self.level+1
self.hp=hp+300 self.hp=self.hp+300
self.attack=attack+100 self.attack=self.attack+100
sb=Hero("傻逼",100,20) sb=Hero("傻逼",100,20)
sb.upgrad() sb.upgrad()
print(sb) print(sb.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