Commit 50ebf952 by BellCodeEditor

save project

parent 1b9c0fd0
Showing with 7 additions and 7 deletions
......@@ -4,13 +4,13 @@ class Hero:
self.hp=hp
self.attack=attack
self.name=name
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
yase=Hero('亚瑟',100,30)
upgrade()
print('亚瑟的等级:',yase.level)
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
hoyi=Hero('后羿',200,20)
hoyi.upgrade()
print('后羿的等级:',hoyi.level)
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