有类的定义如下,以下选项在类外调用正确的是?classB(object):()def()init()(self,value1,value2):()self.()pinPai=value1()self.

10 查阅

有类的定义如下,以下选项在类外调用正确的是?classB(object):()def()init()(self,value1,value2):()self.()pinPai=value1()self.()type=value2()defsetValue(self,value1,value2):()self.()pinPai=value1()self.()type=value2()definfor(self):()print(这是{}牌的{}车。.format(self.()pinPai,self.()type))()

A.x1=B("某某","电动")print(x1.tpye)

B.x1=B("某某","电动")x1.setValue("x1","xx","新能源")

C.x1=B("某某","电动")x1.infor

D.x1=B("某某","电动")x1.infor()

参考答案:

答案:x1=B("某某","电动")x1.infor()