Commit 7095b7a6 by BellCodeEditor

save project

parent 6c7881c2
Showing with 6 additions and 3 deletions
......@@ -5,6 +5,9 @@ class Hero:
self.hp=hp
self.attack=attack
huamulan=Hero("花木兰",300,20)
zhujiaoliang=Hero("猪脚亮",2400,1)
print("花木兰的血量为:",huamulan.hp)
print("猪脚亮的血量为:",zhujiaoliang.attack)
def upgrade():
huamulan.level=huamulan.level+1
huamulan.hp=huamulan.hp+200
huamulan.attack=huamulan.attack+10
upgrade()
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