Commit 96ecc191 by BellCodeEditor

save project

parent 3eecce1a
Showing with 6 additions and 5 deletions
......@@ -4,9 +4,10 @@ class Hero:
self.name = name
self.hp=hp
self.attack=attack
def upgrade(self):
self.levle=self.levle+1
self.hp=self.hp+40
self.attack=self.attack+20
yao=Hero("瑶",300,89)
def upgrade():
yao.hp=yao.hp+40
yao.attack=yao.attack+20
upgrade()
print(yao.hp)
yao.upgrade()
print(yao.levle)
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