fork download
  1. def implication(a, b):
  2. return not a or b
  3.  
  4. for x in (0,1):
  5. for y in (0,1):
  6. for z in (0,1):
  7. for w in (0,1):
  8. f1 = int(implication(w,y) == implication(z,x))
  9. f2 = int(implication(w,y) and (not x) == z)
  10. print(x, y, z, w, '|', f1, f2)
Success #stdin #stdout 0.02s 9432KB
stdin
Standard input is empty
stdout
0 0 0 0 | 1 0
0 0 0 1 | 0 0
0 0 1 0 | 0 1
0 0 1 1 | 1 0
0 1 0 0 | 1 0
0 1 0 1 | 1 0
0 1 1 0 | 0 1
0 1 1 1 | 0 1
1 0 0 0 | 1 1
1 0 0 1 | 0 0
1 0 1 0 | 1 0
1 0 1 1 | 0 0
1 1 0 0 | 1 1
1 1 0 1 | 1 1
1 1 1 0 | 1 0
1 1 1 1 | 1 0