Commit d785a69f by BellCodeEditor

save project

parent 5fbeae25
Showing with 8 additions and 13 deletions
......@@ -4,19 +4,14 @@ class Hero:
self.level=1
self.hp=hp
self.attack=attack
bailishoyue=Hero("百里守约",50,9999)
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+999
yase=Hero("亚瑟",50,999)
liushan=Hero("刘禅",50,999)
print(bailishoyue.hp)
print(yase.hp)
print(liushan.hp)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+999
upgrade()
upgrade()
yase.upgrade()
yase.upgrade()
print(yase.level)
print(yase.hp)
print(yase.attack)
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