Commit a9fd325e by BellCodeEditor

auto save

parent fb27c15d
Showing with 35 additions and 2 deletions
\ No newline at end of file class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
yase=Hero("亚瑟",300,20)
hoyi=Hero("后羿",240,23)
diaochan=Hero("貂蝉",230,29)
gaofanghao=Hero("高坊灏",1000000000000000000000,9999999999999)
def upgrate():
yase.level=yase.level+1
yase.hp=yase.hp+1
yase.attack=yase.attack+1
hoyi.level=hoyi.level+1
hoyi.hp=hoyi.hp+1
hoyi.attack=hoyi.attack+1
diaochan.level=diaochan.level+1
diaochan.hp=diaochan.hp+1
diaochan.attack=diaochan.attack+1
gaofanghao.level=gaofanghao.level+1
gaofanghao.hp=gaofanghao.hp+1
gaofanghao.attack=gaofanghao.attack+1
upgrate()
upgrate()
print(yase.attack)
\ 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