human
Can you provide a Python program to find next class in MRO given the following:
I am working on the file "Class and Inheritance/Python_Class and Inheritance.ipynb".
The first task is:
Why is 13?
<img src="multinher_example1.jpeg">

You might notice that in this case, __init__ method in the base class is executed twice.  However, most of time, we want it to execute for only one time.

Super()

When you have multiple inheritance, the super() helps to ensure that the proper method resolution order (MRO) is followed when moving up the inheritance tree.
Super() is to find next class in MRO.
It is also a shortcut to allow you to access the base class of a derived class, without having to know or type the base class name.
Can you write Python program for it?
assistant
#Here is Python program to find next class in MRO.

# Define a simple class named A
class A():
    def __init__(self, a):
        print('enter A')
        self.a = a
        print(self.a)
        print('leave A')
    
    def method(self):
        print()
        print('method from A')
        print(self.a)

# Try 
instance = A(3)
instance.method()

# Define a class named B which is inherited from A.
class A():
    def __init__(self, a):
        print('enter A')
        self.a = a
        print(self.a)
        print('leave A')
    
    def method(self):
        print()
        print('method from A')
        print(self.a)

class B(A):
    def __init__(self, b):
        print('enter B')
        super(B, self).__init__('I give from B')
        self.a = 'self.a is changed from B'
        print(self.a)
        print('leave B')

instance = B(1)
instance.method()

# Another example using super()
class B(A):
    def __init__(self, b):
        print('enter B')
        super().__init__('I give from B')
        self.a = 'self.a is changed from B'
        print(self.a)
        print('leave B')

instance = B(1)
instance.method()

# Use inheritance method I mentioned at beginning.
class B(A):
    def __init__(self, b):
        print('enter B')
        A.__init__(self, 'I give from B')
        self.a = 'self.a is changed from B'
        print(self.a)
        print('leave B')

instance = B(1)
instance.method()