Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Boolean Algebra by razinkovaleksey
OPERATION_NAMES = ("conjunction", "disjunction", "implication", "exclusive", "equivalence")
def boolean(x, y, operation):
result = {'conjunction': x*y, 'disjunction' : max(x,y), 'implication': int(x<=y) , 'exclusive': int(not(x*y))*max(x,y), 'equivalence' : int(x==y)}
return(result[operation])
May 10, 2016