Commit 2a134e14 by BellCodeEditor

save project

parent ae22baec
Showing with 8 additions and 7 deletions
...@@ -4,15 +4,16 @@ class Hero: ...@@ -4,15 +4,16 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.name=name self.name=name
def a(self):
self.level=self.level+1
self.hp=self.hp+57
self.attack=self.attack+5
yese=Hero('亚瑟',300,20) yese=Hero('亚瑟',300,20)
hoyi=Hero('后羿',240,23) hoyi=Hero('后羿',240,23)
print(yese.hp) print(yese.hp)
print(hoyi.hp) print(hoyi.hp)
def a(): yese.a()
yese.level=level+1 hoyi.a()
yese.hp=hp+57 print(yese.hp)
yese.attack=attack+33333333333333333333333333333333333333333333333 print(hoyi.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