Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Just describe all operations solution in Clear category for Boolean Algebra by roenke
operations = {
"conjunction": lambda x, y: x * y,
"disjunction": lambda x, y: 1 if x != 0 or y != 0 else 0,
"implication": lambda x, y: 0 if x == 1 and y == 0 else 1,
"exclusive": lambda x, y: 1 if x != y else 0,
"equivalence": lambda x, y: 1 if x == y else 0
}
def boolean(x, y, operation):
return operations[operation](x, y)
June 3, 2016