Farz0l1x

Untitled

Mar 4th, 2023
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from itertools import *
  2. def f(x, y, z, w):
  3.     return (((not(x)) and y) == z) and w
  4. for a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 in product([0, 1], repeat = 10):
  5.     table = [(a1, 0, a2, a3), (a4, a5, a6, 0), (0, 0, a7, a8), (0, 0, a9, a10)]
  6.     if len(table) == len(set(table)):
  7.         for p in permutations('wxyz'):
  8.             if [f(**dict(zip(p, r))) for r in table] == [1, 1, 1, 1]:
  9.                 print(p)
Advertisement
Add Comment
Please, Sign In to add comment