import math class Point: # this is the base class """Class that represents a point """ def __init__(self, x=0, y=0): self.x = x self.y = y class Circle(Point): # is derived from Point """Class that represents a circle """ def __init__(self, x=0, y=0, radius=0): Point.__init__(self, x, y) self.radius = radius def area(self): return math.pi * self.radius ** 2 class Cylinder(Circle): # is derived from Circle """Class that represents a cylinder""" def __init__(self, x=0, y=0, radius=0, height=0): Circle.__init__(self, x, y, radius) self.height = height def volume(self): return self.area() * self.height if __name__ == "__main__": d = Circle(0, 0, 1) print(d.area()) print("attributes of circle object are") print(dir(d)) c = Cylinder(0, 0, 1, 2) print(c.volume()) print("attributes of cylinder object are") print(dir(c))