Commit 718cb29b by BellCodeEditor

save project

parent faf7ddaf
Showing with 8 additions and 8 deletions
...@@ -4,14 +4,14 @@ class Hero: ...@@ -4,14 +4,14 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(self):
self.hp=yase.hp+800
self.level=yase.level+1
self.attack=yase.attack+80
yase=Hero("亚瑟",300,50) yase=Hero("亚瑟",300,50)
def upgrade(): yase.upgrade()
yase.hp=yase.hp+800 print("亚瑟的血量为",yase.hp)
yase.level=yase.level+1
yase.attack=yase.attack+80
upgrade()
upgrade()
print("亚瑟",yase.attack)
print("亚瑟",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