Commit 71d9bdb0 by BellCodeEditor

save project

parent d60ebbcc
Showing with 5 additions and 6 deletions
......@@ -5,12 +5,11 @@ class Hero:
self.hp=hp
self.attack=attack
def upgrade():
houyi.level=houyi.level+1
houyi.hp=houyi.hp*2.5
houyi.attack=houyi.attack*1.5
def upgrade(self):
self.level=self.level+1
self.hp=self.hp*2.5
self.attack=self.attack*1.5
yase=Hero("亚瑟",250,23)
houyi=Hero("后羿",300,20)
upgrade()
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