Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
very clear lambdas solution in Clear category for Boolean Algebra by fishsouprecipe
OPERATION_NAMES = {
"conjunction": lambda a, b: a & b,
"disjunction": lambda a, b: a | b,
"implication": lambda a, b: a <= b,
"exclusive": lambda a, b: a ^ b,
"equivalence": lambda a, b: a == b
}
def boolean(x, y, operation):
return OPERATION_NAMES[operation](x, y)
March 8, 2020
Comments: