You are viewing a single comment's thread. Return to all comments →
cuboid = []
results = [cuboid.append([x, y, z]) for x in range(X+1) for y in range(Y+1) for z in range(Z+1) if x + y + z != N]
print(cuboid)
Less lines, more Pythonic
Seems like cookies are disabled on this browser, please enable them to open this website
List Comprehensions
You are viewing a single comment's thread. Return to all comments →
cuboid = []
results = [cuboid.append([x, y, z]) for x in range(X+1) for y in range(Y+1) for z in range(Z+1) if x + y + z != N]
print(cuboid)
Less lines, more Pythonic