首页 > 试题广场 >

以下代码classParent(object):x=1cla

[不定项选择题]
以下代码
class Parent(object):
  x = 1
 class Child1(Parent):
  pass
 class Child2(Parent):
  pass
 Child1.x = 2
 Parent.x = 3
 print Parent.x, Child1.x, Child2.x
运行结果不正确的是?
  • 111
  • 121
  • 322
  • 123
为什么不是3 2 3
发表于 2021-08-23 12:16:49 回复(1)