def changePrice(self,newPrice): if type(newPrice) is int: self.__price = newPrice else: print("本次价格修改不成功")