Commit 99e19c3a by BellCodeEditor

save project

parent a9e7d0d6
Showing with 4 additions and 4 deletions
......@@ -4,10 +4,10 @@ class Hero:
self.name = name
self.hp = hp
self.attack = attack
def upgrade():
seif.level=seif.leve1+1
seif.hp=seif.hp + 50
seif.attack=seif.attack + 4
def upgrade(self):
self.level=self.leve1+1
self.hp=self.hp + 50
slif.attack=self.attack + 4
houyi = Hero("后羿",240,23)
houyi.upgrade()
print("血量为:",houyi.level)
......
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