class MOUSE:
def __init__(self):
self.__hp = 6
self.attack = 4
self.speed = 4
self.skin = "神探警长"
def invisible(self):
print("释放隐身")
def run(self):
print("跑")
def cheese(self):
print("推奶酪")
def show(self):
print(self.__hp)
def change(self, new_hp):
self.__hp = new_hp
if new_hp > 11:
print("你违反了规矩,现已永久封号,拜拜了您嘞")
jerry = MOUSE()
jerry.run()
jerry.change(8888888888)
jerry.show()
class CAT:
def __init__(self):
self.hp = 10
self.attack = 5
self.speed = 8
self.skin = "精灵王"
def silent(self):
print('释放沉默技能')
def run(self):
print("跑")
def catch(self):
print("抓老鼠")
tom = CAT()
print(tom.hp)
tom.run()