Commit cadef49a by BellCodeEditor

save project

parent b3fe4bd0
Showing with 33 additions and 6 deletions
......@@ -4,13 +4,40 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def up():
luban.level+=1
luban.hp+=100
luban.attack+=100
def up(self):
self.level+=1
self.hp+=100
self.attack+=100
luban=Hero('鲁班',500,60)
jialuo=Hero('伽罗',600,70)
up()
up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
luban.up()
print('鲁班的血量值为:',luban.hp)
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