class rectangle:
def display (self):
print("This is a Rectangle")
def area(self,length, breadth):
a = length * breadth
print("Area of Rectangle is ",a)
class square:
def display(self):
print("This is a Square")
def area(self,side):
A = side*side
print("Area of square is ",A)
=======================================================================
class parent:
def __init__(self,totalasset):
self.totalasset = totalasset
def display(self):
print("Total Asset Worth is "+str(self.totalasset)+" Million.")
print("Share of Parents is "+str(round(self.totalasset/2,2))+" Million.")
class son(parent):
def __init__(self, total, val):
parent. __init__(self,total)
self.ps = total * val/100
def son_display(self):
print("Share of Son is {} Million.".format(round(self.ps,2)))
class daughter(parent):
def __init__(self, total, val):
parent. __init__(self,total)
self.pd = total*val/100
def daughter_display(self):
print("Share of Daughter is {} Million.".format(round(self.pd,2)))