Advertisement
MathQ_

Untitled

Dec 8th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. ansy = [1,
  2.         0,
  3.         1,
  4.         0,
  5.         1,
  6.         1,
  7.         1,
  8.         0,
  9.         1,
  10.         1,
  11.         1,
  12.         0,
  13.         1,
  14.         1,
  15.         1,
  16.         0]
  17.  
  18. lol = [False, True]
  19.  
  20.  
  21. def impl(a, b):
  22.     return (not a or b)
  23.  
  24.  
  25. def f(a, b, c, d):
  26.     return int(impl(impl(impl(a, b), c), d))
  27.  
  28.  
  29. def check(n1, n2, n3, n4):
  30.     kek = []
  31.     for a in lol:
  32.         for b in lol:
  33.             for c in lol:
  34.                 for d in lol:
  35.                     a1, b1, c1, d1 = a, b, c, d
  36.                     if n1:
  37.                         a1 = not a1
  38.                     if n2:
  39.                         b1 = not b1
  40.                     if n3:
  41.                         c1 = not c1
  42.                     if n4:
  43.                         d1 = not d1
  44.                     print(a1, b1, c1, d1)
  45.                     kek.append(f(a1, b1, c1, d1))
  46.     return kek == lol
  47.  
  48.  
  49. def WOW():
  50.     for a in lol:
  51.         for b in lol:
  52.             for c in lol:
  53.                 for d in lol:
  54.                     if check(a, b, c, d):
  55.                         print("WOW")
  56.                         print(a, b, c, d)
  57.  
  58. WOW()
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement