Commit 61df6cc5 by BellCodeEditor

save project

parent a8818ca9
Showing with 6 additions and 6 deletions
......@@ -3,16 +3,16 @@ class Hero():
self.level=1
self.hp=hp
self.attack=attack
def update():
damo.level=damo.level+1
damo.hp=damo.hp+100
damo.atack=damo.attack+5
def update(self):
self.level=self.level+1
self.hp=self.hp+100
self.atack=self.attack+5
damo=Hero("达摩",300,50)
houyi=Hero("后羿",250,80)
print("初始血量为",damo.hp)
update()
update()
damo.update()
damo.update()
print("升两级血量为",damo.hp)
print(damo.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