Commit bf0336fd by BellCodeEditor

auto save

parent 850ddbc0
Showing with 5 additions and 5 deletions
......@@ -5,13 +5,13 @@ class Hero:
self.hp = hp
self.attack = attack
def upgrade(self):
self.level= level+1
self.hp=.hp+50
self.attack=.attack+4
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
yase = Hero("亚瑟",300,20)
yase.upgrade()
print("亚瑟的血量为:",yase.hp)
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