import itertools
def f(x,y,z,w):
return ((x and y) or (y and z)) == ((not(x) or w) and (not(w) or z))
for p in itertools.permutations("xyzw"):
ans = []
t = [(0,1,1,1), (0,1,0,0), (0,1,0,1)]
for r in t:
#ans.append(f(*r))
#ans.append(f(**dict(zip(p,r))))
if ans == [1,1,1]:
print(*p)
break
If I uncomment ans.append(f(*r))
it outputs nothing, but if I uncomment ans.append(f(**dict(zip(p,r))))
it outputs my answer. Why does that happen?
I'm expecting the same output, but there are different arrays after dict(zip)
values.