You are viewing a single comment's thread. Return to all comments →
Trade three +1's for a +1 and a -1 at the right place :P
x, y, z, n = (int(raw_input())+1 for _ in range(4)) print [[a,b,c] for a in range(x) for b in range(y) for c in range(z) if a+b+c!=n-1]
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 →
Trade three +1's for a +1 and a -1 at the right place :P