Commit d7d1d3c6 by BellCodeEditor

save project

parent 6ad9805e
Showing with 11 additions and 8 deletions
...@@ -4,11 +4,14 @@ class Hero: ...@@ -4,11 +4,14 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.gong=gong self.gong=gong
def shengji(self):
self.level=self.level+1
self.hp=self.hp+50
self.gong=self.gong+4
houyi=Hero('后羿',240,25)
yase=Hero('亚瑟',300,20) yase=Hero('亚瑟',300,20)
def shengji(): houyi.shengji()
yase.level=yase.level+1 yase.shengji()
yase.hp=yase.hp+50 print(yase.hp)
yase.gong=yase.gong+4 print(houyi.gong)
shengji() \ No newline at end of file
shengji()
print(yase.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