第41723题 单选题
下列代码中,执行 d1.work() 和 d2.work() 输出不同结果的主要原因是( )。
class Device:
    def work(self):
        print("Device is working")

class Printer(Device):
    def work(self):
        print("Printer is printing")

class Scanner(Device):
    def work(self):
        print("Scanner is scanning")

if __name__ == '__main__':
    d1 = Printer()
    d2 = Scanner()

    d1.work()
    d2.work()
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析