Commit 0683e17c by BellCodeEditor

save project

parent 3a44990c
Showing with 10 additions and 7 deletions
......@@ -5,14 +5,17 @@ class Hero:
self.hp=hp
self.attack=attack
yase=Hero("亚瑟",300,20)
houyi=Hero("后裔",250,23)
def yasedengji():
yase.level=yase.level+1
yase.hp=yase.hp+500
yase.attack=yase.attack+20000
yasedengji()
def dengji(self):
self.level=self.level+1
self.hp=self.hp+500
self.attack=self.attack+20000
yase=Hero("亚瑟",300,20)
print("亚瑟的原登记为",yase.level)
yase.dengji()
print("亚瑟的现等级为",yase.level)
houyi=Hero("后裔",250,23)
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