Commit d7d1d3c6 by BellCodeEditor

save project

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