Commit 0d53296d by BellCodeEditor

save project

parent 3c0263fb
Showing with 11 additions and 5 deletions
class Hero: class Hero:
def __init__(serf,name,hp,attack): def __init__(self,name,hp,attack):
serf.level=1 self.level=1
serf.name=name self.name=name
serf.hp=hp self.hp=hp
serf.attack=attack self.attack=attack
yase=Hero("垭瑟",300,20) yase=Hero("垭瑟",300,20)
hoyi=Hero("后羿",250,23) hoyi=Hero("后羿",250,23)
zhuaizhuaixion=Hero("拽拽熊",0.01,0.0000000001) zhuaizhuaixion=Hero("拽拽熊",0.01,0.0000000001)
def upgarde():
yase.level+=1
hoyi.hp+=1
zhuaizhuaixion.attack+=1
upgarde()
print(yase.hp) print(yase.hp)
print(hoyi.hp) print(hoyi.hp)
print(zhuaizhuaixion.hp) print(zhuaizhuaixion.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