Commit d4b5c551 by BellCodeEditor

save project

parent fab70554
Showing with 4 additions and 4 deletions
......@@ -4,12 +4,12 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('垭瑟',300,20)
houyi=Hero('后羿',250,23)
def upgrade():
def upgrade(self):
self.level+=1
self.hp+=50
self.attack+=20
upgrade
yase=Hero('垭瑟',300,20)
houyi=Hero('后羿',250,23)
yase.upgrade()
print(yase.hp)
print(houyi.name)
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