Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import *
- def f(x, y, z, w):
- return ((x <= y) or (z <= w)) and not(x <= w)
- for a in product([0, 1], repeat = 5):
- table = [(1, 0, 1, a[0]), (1, a[1], a[2], 1), (a[3], a[4], 1, 0)]
- if len(table) == len(set(table)):
- for p in permutations('xywz'):
- if [f(**dict(zip(p, r))) for r in table] == [0, 1, 1]:
- print(p)
Advertisement
Add Comment
Please, Sign In to add comment