Commit 20073435 by BellCodeEditor

save project

parent 12417997
Showing with 7 additions and 15 deletions
class Hero:
def __init__(self,name,hp,gongji):
self.level=1
self.name=name
self.hp=hp
self.gongji=gongji
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)
def sum(num):
if num == 1:
return 1
x=sum(num-1)
return x+num
m=sum(100)
print(m)
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