Commit 44daecb7 by BellCodeEditor

save project

parent 66e73e90
Showing with 7 additions and 9 deletions
......@@ -4,14 +4,12 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
houyi=Hero('后羿',1234567890,9876543210)
yase=Hero('垭瑟',1029384756,1092837465)
def upgrade():
yase.level = yase.level+1
yase.hp=yase.hp+10000
yase.attack=yase.attack+100000
upgrade()
upgrade()
print(yase.hp)
def upgrade(self):
self.level = self.level+1
self.hp=self.hp+10000
self.attack=self.attack+100000
houyi=Hero('后羿',7890,3210)
houyi.upgrade()
print(houyi.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