Accademia:Algebra booleana.py
#!/usr/bin/env python3 def NOT(val): return not val def OR(val1, val2): return val1 or val2 def AND(val1, val2): return val1 and val2 def XOR(val1, val2): return val1 != val2 def NOR(val1, val2): return not (val1 or val2) def NAND(val1, val2): return not (val1 and val2) def XNOR(val1, val2): return val1 == val2