Advertisement
boris-vlasenko

logic_test

May 30th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. def f(x):
  2.     x,y,w,z = map(int,x)
  3.     return ((not y or x) or (not z and w)) == (w == x)
  4.    
  5. n = 4
  6. for i in range(2**n):
  7.     x = bin(i)[2:]
  8.     x = '0' * (n-len(x)) + x
  9.     if f(x):
  10.         print(x,f(x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement