Diamond Shape problem in python.

 Diamond Shape problem in python.

Code - 

-------------------------------------

class A:

    def met(self):

        return "Hello this is a diamond shape problem of class A"



class B(A):

    def met(self):

        return "Hello this is a diamond shape problem of class B"



class C(A):

    def met(self):

        return "Hello this is a diamond shape problem of class C "



class D(B, C):

    def met(self):

        return "Hello this is a diamond shape problem of class D"



a = A()

b = B()

c = C()

d = D()

print(d.met())

Comments

Popular posts from this blog

Single Inheritance, multiple inheritance and multilevel inheritance in python.

Git Commands.

Using class objects, Instance variables, and class variables, class methods and static method in python