Commit 44daecb7 by BellCodeEditor

save project

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