human
I am working on the file "Section 1 - Core Python/Chapter 09 - Classes & OOPS/02_02_Single_Inheritance.ipynb".
The first task is:
Now lets create the same classes without init functions, and see what happens
Can you write Python code for it?
assistant
#Here happens
.

class grand_parent:
    def __init__(self, middle_name):
        print("grand_parent init")
        self.__middle_name = middle_name
        
    def middle_name(self, middle_name):
        self.__middle_name = middle_name
        return self.__middle_name

class parent(grand_parent):
    def __init__(self, middle_name, surname):
        print("parent init")
        self.__surname = surname
    
    def middle_name(self):
        return self.__middle_name
    
    
class student(parent):
    def __init__(self, name, middle_name, surname):
        print("student init")
        self.name = name

mohan = student("Venkat", "kumar", "Mohan")

try:
    print(mohan.middle_name())
except Exception as e:
    print(e)