Commit a5c6b325 by BellCodeEditor

save project

parent a1f5bdfc
Showing with 8 additions and 8 deletions
......@@ -4,17 +4,17 @@ class Hero:
self.attack=attack
self.hp=hp
self.name=name
def upgrade(self):
self.hp=self.hp+80
self.attack=self.attack+20
self.level=self.level+1
yase=Hero("亚瑟",600,50)
houyi=Hero("后羿",450,80)
print(yase.hp)
yase.upgrade()
houyi.upgrade()
print(houyi.hp)
def upgrade():
yase.hp=yase.hp+80
yase.attack=yase.attack+20
yase.level=yase.level+1
upgrade()
print(yase.hp)
......
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