Commit e47d10f1 by BellCodeEditor

save project

parent 3d48fa68
Showing with 12 additions and 6 deletions
......@@ -4,14 +4,20 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade():
houyi.level=houyi.level+1
houyi.hp=houyi.hp+50
houyi.attack=houyi.attack+4
yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
houyi=Hero('houyi',250,23)
k=Hero('K',5600,199)
print(yase.attack)
print(hy.attack)
print(houyi.attack)
print(k.attack)
upgrade()
upgrade()
print("升级2次后,后羿的血量值为:",houyi.hp)
def upgrade():
hoyi.level=hoyi.level+1
hoyi.hp=hoyi.hp+50
hoyi.attack=hoyi.attack+4
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