Commit e195df94 by BellCodeEditor

save project

parent 01cb1d0a
Showing with 4 additions and 4 deletions
...@@ -6,11 +6,11 @@ class Hero: ...@@ -6,11 +6,11 @@ class Hero:
self.attack=attack self.attack=attack
def upgrade(): def upgrade():
yase.level=yase.level+1 yase.level=yase.level+1
yase.hp=yase.hp+50 yase.hp=yase.hp+100
yase.attack=yase.attack+4 yase.attack=yase.attack+8
yase=Hero('亚瑟',200,15) yase=Hero('亚瑟',100,10)
print('亚瑟的初始血量值为:',yase.hp) print('亚瑟的初始血量值为:',yase.hp)
upgrade( ) upgrade( )
upgrade( ) upgrade( )
print('升级两次后,血量为:',yase.hp) print('升级两次后,血量为:',yase.hp)
print("升级两次后,攻击为:",yase.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