Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
lambda references solution in Creative category for Boolean Algebra by swagg010164
def boolean(x, y, operation):
OPERATION_NAMES = {"conjunction": lambda x, y: x & y, \
"disjunction": lambda x, y: x | y, \
"implication": lambda x, y: (not x) | y, \
"exclusive": lambda x, y: (x|y) & (not x & y), \
"equivalence": lambda x, y: x == y}
return OPERATION_NAMES[operation](x, y)
Nov. 20, 2018