muitiple inner classes in python

Solutions on MaxInterview for muitiple inner classes in python by the best coders in the world

showing results for - "muitiple inner classes in python"
Astrid
21 Nov 2018
1class Outer:
2    """Outer Class"""
3
4    def __init__(self):
5        ## Instantiating the 'Inner' class
6        self.inner = self.Inner()
7        ## Instantiating the '_Inner' class
8        self._inner = self._Inner()
9
10    def show_classes(self):
11        print("This is Outer class")
12        print(inner)
13        print(_inner)
14
15    class Inner:
16        """First Inner Class"""
17
18        def inner_display(self, msg):
19            print("This is Inner class")
20            print(msg)
21
22    class _Inner:
23        """Second Inner Class"""
24
25        def inner_display(self, msg):
26            print("This is _Inner class")
27            print(msg)
28
29    ## ...