ProghubPH

Deal with inheritance. What is the output?

 single option
class A(object):
  foo = 1

class B(A):
  pass

class C(A):
  foo = 2

class D(B, C):
  pass

d = D()
print(d.foo)
1
2
1 in Python 2 2 in Python 3
ClassAttributeAccessError: class attribute 'foo' used outside of the corresponding class