Multiple Inheritance example
This commit is contained in:
parent
e78b5b9dea
commit
7280eead01
16
python-temel/multiple.py
Normal file
16
python-temel/multiple.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
class A:
|
||||||
|
def foo(self):
|
||||||
|
print('foo')
|
||||||
|
|
||||||
|
class B:
|
||||||
|
def bar(self):
|
||||||
|
print('bar')
|
||||||
|
|
||||||
|
class C(A, B):
|
||||||
|
def tar(self):
|
||||||
|
print('tar')
|
||||||
|
|
||||||
|
c = C()
|
||||||
|
c.foo()
|
||||||
|
c.bar()
|
||||||
|
c.tar()
|
Loading…
Reference in New Issue
Block a user