In this we are going to see a basic program to find area of square by single inheritance in Python Programming Language.
class Area():
def __init__(self,side):
print("Area Class")
self.side = side
def getArea(self):
area = self.side * self.side
return area
class Square(Area):
def __init__(self,side):
super().__init__(side)
print("Square Class")
s = Square(4)
print("Area Is : ",s.getArea())
# Coded By Dhiraj Shelke
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP