Commit ad3940b8 by BellCodeEditor

auto save

parent 345679ff
Showing with 7 additions and 5 deletions
......@@ -4,12 +4,13 @@ class Hero:
self.name = name
self.hp = hp
self.attack = attack
def upgrade(self):
self.level+=1
self.hp+=40
self.attack+=40
lan=Hero('澜',300,999)
print(lan.hp)
def upgrade():
lan.level+=1
lan.hp+=40
lan.attack+=100
upgrade()
lan.upgrade()
print(lan.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