Commit 97548af0 by BellCodeEditor

auto save

parent ec9cb954
Showing with 12 additions and 7 deletions
......@@ -4,14 +4,19 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
yase=Hero("亚瑟"30020)
houyi=Hero("后羿"25023)
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+5
yase=Hero("亚瑟",300,20)
houyi=Hero("后羿",250,25)
yase.upgrade()
houyi.upgrade()
print(yase.level)
print(yase.hp)
print(yase.attack)
print(houyi.level)
print(houyi.hp)
print(houyi.attack)
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