def middle(shape):
    """ Given the 2D vertices of a shape, return the coordinates of the middle
        of the shape.
    """
    return (sum(p[0] for p in shape) / len(shape),
            sum(p[1] for p in shape) / len(shape))