Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Boolean Algebra by mdafanasev
def boolean(x, y, operation):
x, y = bool(x), bool(y);
op_map = {
'conjunction': (lambda x,y: x and y),
'disjunction': (lambda x,y: x or y),
'implication': (lambda x,y: not(x) or y),
'exclusive': (lambda x,y: x != y),
'equivalence': (lambda x,y: x == y)
}
return op_map[operation](x,y)
Oct. 16, 2017