Commit 939d219f by BellCodeEditor

auto save

parent 7f6f09cd
Showing with 7 additions and 0 deletions
......@@ -3,5 +3,12 @@ class hero():
self.level=level
self.hp=hp
self.attack=attack
def upgrade():
yase.level=yase.level+2
yase.hp=yase.hp+50
yase.attack=yase.attack+5
yase=hero('亚瑟',5,500,2)
print('亚瑟的攻击',yase.attack)
upgrade()
upgrade()
print('升级2次后,输出亚瑟的血量:',yase.hp)
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