Name: Anonymous 2009-01-09 3:20
hai guys, because I love you so much I made you a present:
def OR(a,b):
""" Returns A + B
"""
x = bool(a) or bool(b)
return x
def AND(a,b):
""" Returns A.B
"""
x = bool(a) and bool(b)
return x
def XOR(a,b):
""" Returns A(XOR)B
"""
if bool(a) and bool(b):
x = False
else:
x = bool(a) or bool(b)
return x
def INV(a):
""" Returns -A
"""
return XOR(a, True)
def NAND(a,b):
""" Returns -(A.B)
"""
return INV(AND(a,b))
def NOR(a,b):
""" Returns -(A + B)
"""
return INV(OR(a,b))
def XNOR(a,b):
""" Returns -(A(XOR)B)
"""
return INV(XOR(a,b))