Commit 4c656b50 by BellCodeEditor

save project

parent 22354288
Showing with 17 additions and 0 deletions
class hero:
def __init__(self,lever,hp,):
self.lever=lever
self.hp=hp
yase=hero("亚瑟",1,300)
houyi=hero("后羿",1,240)
print("亚瑟的血量为",yase.hp)
print("后羿的血量为",houyi.hp)
class upgrade:
def __init__(self):
self.lever=self.lever+1
self.hp=self.hp+40
yase=hero(1,300)
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