第11213题 单选题
给定Python代码中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 }}%
答案解析