1 class A: 2 __x = 3 3 def f(self): 4 print self.__x 5 6 class B(A): 7 __x = 4 8 9 class C(B): 10 __x = 5 11 def f(self): 12 print self.__x 13 14 a = A() 15 a.f() 16 b = B() 17 b.f() 18 c = C() 19 c.f()