单选题 适中
#6246

有如下Python程序: class Cars(): def __init__(self,color,shape): self.color = color se…

有如下Python程序:

class Cars():
    def __init__(self,color,shape):
        self.color = color 
        self.shape = shape 
        print('您定制的{}{}已经生产好了!'.format(self.color,self.shape))
new_car = Cars('红色','小汽车')

执行程序后,打印的结果是?( )

未登录也能判分,登录后才会记录
答案与解析
正确答案:D
解析

根据代码可知,创建了实例new_car,自动调用构造函数内容,打印相关内容,所以选D。