Commit 9ea247d1 by BellCodeEditor

save project

parent 6b36d060
Showing with 12 additions and 9 deletions
......@@ -4,15 +4,18 @@ class Hero:
self.name = name
self.hp= hp
self.attack= attack
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
yase = Hero("亚瑟",300,20)
print("亚瑟初始血:",yase.hp)
upgrade()
upgrade()
print("生级2此后,亚瑟初始血:",300,20)
def unpgrade():
self.level=yase.level+1
self.hp=yase.hp+50
self.attack=yase.attack+4
houyi = Hero("后羿",240,23)
houyi.unpgrade()
print("等级:",houyi.)
print("血量:",houyi.hp)
print("攻击力:",houyi.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