Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import product
- variables_amount = 3
- variants = [0, 1]
- truth_table = list(product(variants, repeat=variables_amount))
- def f(x, y, z):
- return not(x or y ) or (z == x)
- print("x", "y", "z", " f")
- for row in truth_table:
- result = f(*row)
- if result == 0:
- print(*row, f(*row))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement