class Hero: def __init__(self,name,hp,attack): self.level=1 self.name=name self.hp=hp self.attack=attack yase=Hero('yase',300,20) houyi=Hero('hy',240,23) print(yase.attack) print(yase.attack) print(后羿的血量为:"houyi.hp) print(垭瑟的血量为:"yase.hp)