Commit 9ae3d96f by BellCodeEditor

save project

parent e37e171d
Showing with 4 additions and 4 deletions
......@@ -5,11 +5,11 @@ 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
houyi = Hero("后裔",240,23)
houyi.upgrade()
print("等级为:",houyi.levle)
print("等级为:",houyi.level)
print("血量为:",houyi.hp)
print("攻击力为:",houyi.attack)
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