Commit 9760374e by BellCodeEditor

save project

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