Commit caad0f14 by BellCodeEditor

save project

parent 1f4f1940
Showing with 7 additions and 7 deletions
......@@ -4,11 +4,11 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
pengpenglaoshi=Hero("彭彭老师",300,20)
#print(pengpenglaoshi.hp)
def upgride():
pengpenglaoshi.level=pengpenglaoshi.level+1
pengpenglaoshi.hp=pengpenglaoshi.hp+50
pengpenglaoshi.attack=pengpenglaoshi.attack+4
upgride()
def upgride(self):
self.level=self.level+1
self.hp=self.hp+70
self.attack=self.attack+10
pengpenglaoshi=Hero("彭彭老师",300,9999)
Hero.upgride(pengpenglaoshi)
print(pengpenglaoshi.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