Untitled

mail@pastecode.io avatar
unknown
python
6 months ago
799 B
2
Indexable
Never
class CDRaw:
    def drawCircle(self):
        print("draw circle")
    def drawRectangle(self):
        print("draw rectangle")
    def drawShape(self):
        print("draw shape")
        
cdRaw = CDRaw()
cdRaw.drawCircle()
cdRaw.drawRectangle()
cdRaw.drawShape()

class ICDRaw:
    def draw(self):
        #print("IDraw")
        pass

class Circle(ICDRaw):
    def draw(self):
        print("draw circle")
        
class Rectangle(ICDRaw):
    def draw(self):
        print("draw rectangle")
        
class Shape(ICDRaw):
    def draw(self):
        print("draw shape")

class Client:
    def __init__(self):
        icraw=ICDRaw()
        icraw.draw()
        icraw=Circle()
        icraw.draw()
        icraw=Rectangle()
        icraw.draw()
        icraw=Shape()
        icraw.draw()
Client()