Commit 5de96411 by BellCodeEditor

save project

parent efb1e72e
Showing with 10 additions and 0 deletions
...@@ -5,3 +5,13 @@ class Hero: ...@@ -5,3 +5,13 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade():
yase.level=yase.level+1
yase.hp=yase+50
yase.attack=yase.attack+4
yase =Hero("亚鉍",300,20)
print("亚鉍的初始的血量为:",yase.hp)
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