• 2022-06-17
    关于下列Python代码,说法正确的是class Cat: def __init__(self, age, eye_color): self.age = age self.eye_color = eye_color def voice(self): return '喵' cat = Cat(1,'blue')print(cat.age,cat.eye_color,cat.voice())
    A: 程序可以运行,且输出结果为 1 blue 喵
    B: 程序可以运行,且输出结果为 1 blue
    C: 程序不可以运行,因为voice不是cat的某个方法,而是属性
    D: 程序不可以运行,因为voice方法的返回值并不能输出