Commit 9760374e by BellCodeEditor

save project

parent 6fbec55e
Showing with 9 additions and 10 deletions
...@@ -5,16 +5,16 @@ class Hero: ...@@ -5,16 +5,16 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def upgrade(self):
yase.level+=1 self.level+=1
yase.hp+=100 self.hp+=100
yase.attack+=10000 self.attack+=10000
yase=Hero("亚瑟",300,20) houyi=Hero("后羿",250,23)
print(yase.hp) houyi.upgrade()
print('级为:',houyi.level)
print('血为:',houyi.hp)
print('攻为:',houyi.attack)
upgrade()
upgrade()
print(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