Quiz Catalog

Catalog of quizzes

class A(object):
  foo = 1

class B(A):
  pass

class C(A):
  foo = 2

class D(C, B):
  pass

d = D()
print(d.foo)
2
  • class/inherit

class A:
  def __init__(self):
    self.x = 5
  
class B(A):
  pass

print(isinstance(B, A))
False
  • class/inherit
  • build-in/isinstance