你注释掉的一行: eturn '{:s}'.format(self.name)+"{:.2f}".format(self.weight)两个format()间的,换成+号就可以了,用逗号返回的是元组
写错了,用format吧