Commit 0ac5bf81 by BellCodeEditor

save project

parent 83c35c13
Showing with 9 additions and 2 deletions
......@@ -5,7 +5,14 @@ class Hero:
self.hp = hp
self.attack = attack
def upgrade():
yase.level=yase.level+1
yase.attack=yase.attack+4
yase.hp=yase.hp+50
yase = Hero("娅瑟",300,20)
houyi = Hero("猴一",240,23)
print("娅瑟的血量为:",yase.hp)
print("猴一的血量为:",houyi.hp)
\ No newline at end of file
upgrade()
upgrade()
print("升级2次后,娅瑟的血量为:",yase.hp)
\ No newline at end of file
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