Commit 5289a5b5 by BellCodeEditor

save project

parent e9fdb6a7
Showing with 4 additions and 3 deletions
...@@ -4,10 +4,11 @@ class Hero: ...@@ -4,10 +4,11 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("亚瑟",200,150) yase=Hero("亚瑟",200,150)
def upgrade() def upgrade():
self.hp=self.hp+100 yase.hp=yase.hp+100
self.attack=attack+50 yase.attack=yase.attack+50
upgrade() upgrade()
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