(self, height, width)
return shape, color, (x, y, s)
Generates specifications of a random shape that lies within
        the given height and width boundaries.
        Returns a tuple of three valus:
        * The shape name (square, circle, ...)
        * Shape color: a tuple of 3 values, RGB.
        * Shape dimensions: A tuple of values that define the shape size
                            and location. Differs per shape type.
Generates specifications of a random shape that lies within
        the given height and width boundaries.
        Returns a tuple of three valus:
        * The shape name (square, circle, ...)
        * Shape color: a tuple of 3 values, RGB.
        * Shape dimensions: A tuple of values that define the shape size
                            and location. Differs per shape type.
Generates specifications of a random shape that lies within the given height and width boundaries . Returns a tuple of three valus : * The shape name ( square circle ... ) * Shape color : a tuple of 3 values RGB . * Shape dimensions : A tuple of values that define the shape size and location . Differs per shape type .
def random_shape(self, height, width):
        """Generates specifications of a random shape that lies within
        the given height and width boundaries.
        Returns a tuple of three valus:
        * The shape name (square, circle, ...)
        * Shape color: a tuple of 3 values, RGB.
        * Shape dimensions: A tuple of values that define the shape size
                            and location. Differs per shape type.
        """
        # Shape
        shape = random.choice(["square", "circle", "triangle"])
        # Color
        color = tuple([random.randint(0, 255) for _ in range(3)])
        # Center x, y
        buffer = 20
        y = random.randint(buffer, height - buffer - 1)
        x = random.randint(buffer, width - buffer - 1)
        # Size
        s = random.randint(buffer, height//4)
        return shape, color, (x, y, s)
def random_shape ( self , height , width ) : # Shape shape = random . choice ( [ "square" , "circle" , "triangle" ] ) # Color color = tuple ( [ random . randint ( 0 , 255 ) for _ in range ( 3 ) ] ) # Center x, y buffer = 20 y = random . randint ( buffer , height - buffer - 1 ) x = random . randint ( buffer , width - buffer - 1 ) # Size s = random . randint ( buffer , height // 4 ) return shape , color , ( x , y , s )