I have tried this approach:
print((i, j) for i in [0,x] for j in [0, y] if (i+j)!=n) 
where x,y,n are integers.
Formatting the output in python from [(1,2) , (2,3)] to [[1,2], [2,3]]
And you're getting output of <generator object at ...>, because that's the only argument you supply the generator expression. Either turn it into a list comp and unpack it to print:
print(*[(i, j) for i in [0,x] for j in [0, y] if (i+j)!=n])
or create the generator first, iterate through it and print out its results.