Commit ba23fe7e by BellCodeEditor

save project

parent 22354288
Showing with 22 additions and 0 deletions
class Hero:
def __init__(self,Name,hp,attack):
self.level =1
self.name =name
self.hp=hp
self.attack=attack
jieruia=Hero('杰瑞'300,20)
def upgrade(self):
jieruia.level=jieruia.level+1
jieruia.hp=jieruia.hp+50
jieruia.attack=jieruia.attack+4
jieruia=Hero('杰瑞',240,23)
jieruia.upgrade()
print('等级:'jieruia.level)
print('血量:'jieruia.up)
print('攻击:'jieruia.attack)
jieruia =Hero("jieruia",300,20)
print("杰瑞初:"jieruiahp)
upgrade()
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