def cube_points(x1, x2, y1, y2, z1, z2):
    return [(x, y, z) for x in range(x1, x2 + 1) for y in range(y1, y2 + 1) for
        z in range(z1, z2 + 1)]
How to get a list of all integer points in an n-dimensional cube using python?