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

Shopping Bill Generator In python.

Should we start preparation for BCA/MCA from class 11th ? How ?

Python program to check that a list have elements in it or not .