class def make self print make from class def make self print make fro

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
class A:
def make(self):
print('make from A')
class B:
def make(self):
print('make from B')
class C:
def __init__(self, cls):
self.cls = cls
def call_make(self):
obj = self.cls()
obj.make()
o1 = C(A)
o2 = C(B)
o1.call_make()
o2.call_make()