class computer: def __init__(self,color='黑色',money=0): self.color = color self.money = money class notebook(computer): def __init__(self,color,money,brand='',ram='',disk=''): super().__init__(color,money) self.brand = brand self.ram = ram self.disk = disk def show(self): print('筆電品牌=',self.brand) print('記憶體=',self.ram,'硬碟=',self.disk) print('外殼顏色=',self.color,'價格=',self.money) a1 = notebook('銀色',25000,'華碩','6G','1TB') print(a1.show())