第41696题 单选题
下列代码中,s1.draw() 和 s2.draw() 能正确运行并输出不同结果的主要原因是( )。
class Shape:
    def draw(self):
        print("绘制图形")

class Circle(Shape):
    def draw(self):
        print("绘制圆形")

class Rectangle(Shape):
    def draw(self):
        print("绘制矩形")

if __name__ == "__main__":
    s1 = Circle()
    s2 = Rectangle()

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