Commit 85445c30 by BellCodeEditor

auto save

parent 5c2d7299
Showing with 11 additions and 0 deletions
......@@ -5,9 +5,19 @@ class hero:
self.hp=hp
self.attack=attack
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+100
self.attack=self.attack+5
damo = hero("达摩",10000,10)
houyi = hero("后羿",240,200)
damo.upgrade()
houyi.upgrade()
houyi.upgrade()
houyi.upgrade()
print("达摩的等级为",damo.hp)
print("后羿的血量为",houyi.hp)
\ No newline at end of file
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