A b c =
0
0 0 0 0
1
0 0 1 1
2
0 1 0 0
3
0 1 1 1
4
1 0 0 1
5
1 0 1 1
6
1 1 0 1
7
1 1 1 1
def bin_values(in_int): ret = []
b = bin(in_int)[2:]
while len(b) != 3:
b = '0' + b
for i in b:
ret.append(bool(int(i)))
return ret
for xs in range(2**3):
a, b, c = bin_values(xs)
print(xs)
res = a and not c or c and (b or not c) or (a or not b) and c
print(int(a), int(b), int(c), int(res), "\n")