diff --git a/python-temel/taban_ve_turemis.py b/python-temel/taban_ve_turemis.py new file mode 100644 index 0000000..feabe6e --- /dev/null +++ b/python-temel/taban_ve_turemis.py @@ -0,0 +1,20 @@ +class A: + def __init__(self): + print('A __init__ called: {}'.format(type(self))) + self.x = 10 + + def dispA(self): + print('A.Disp: {}'.format(self.x)) + +class B(A): + def __init__(self): + print('B __init__ called: {}'.format(type(self))) + super(B, self).__init__() + self.x = 20 + + def dispB(self): + print('B.Disp: {}'.format(self.x)) + +b = B() +b.dispB() +b.dispA()