Commit b3fe4bd0 by BellCodeEditor

save project

parent bb723990
Showing with 10 additions and 4 deletions
class Hiro: class Hero:
def __init__(self,nema,hp,attack): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
luban=Hero('鲁班',500,203) def up():
jiajuo=Hero('伽罗'600,999999999999999) luban.level+=1
luban.hp+=100
luban.attack+=100
luban=Hero('鲁班',500,60)
jialuo=Hero('伽罗',600,70)
up()
up()
print('鲁班的血量值为:',luban.hp) print('鲁班的血量值为:',luban.hp)
print('鲁班的攻击力为:',luban.attack) print('鲁班的攻击力为:',luban.attack)
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