Inner Class === ```python= # create outer class class Doctors: def __init__(self): self.name = 'Doctor' self.den = self.Dentist() self.car = self.Cardiologist() def show(self): print('In outer class') print('Name:', self.name) # create a 1st Inner class class Dentist: def __init__(self): self.name = 'Dr. Savita' self.degree = 'BDS' def display(self): print("Name:", self.name) print("Degree:", self.degree) # create a 2nd Inner class class Cardiologist: def __init__(self): self.name = 'Dr. Amit' self.degree = 'DM' def display(self): print("Name:", self.name) print("Degree:", self.degree) ``` ## Ref. [Inner Class in Python]([https://](https://www.geeksforgeeks.org/inner-class-in-python/)) ###### tags: `語法相關`