Commit 20073435 by BellCodeEditor

save project

parent 12417997
Showing with 7 additions and 15 deletions
class Hero: def sum(num):
def __init__(self,name,hp,gongji): if num == 1:
self.level=1 return 1
self.name=name x=sum(num-1)
self.hp=hp return x+num
self.gongji=gongji m=sum(100)
print(m)
yase=Hero('亚瑟',200,300)
houyi=Hero('亚瑟',200,300)
def shengji():
houyi.level=houyi.level+1
houyi.hp=houyi.hp+100
houyi.gongji=houyi.gongji+4
shengji()
print('后羿攻击力是:',houyi.gongji)
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