Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Boolean Algebra by Bartek.Knobel
def boolean(x, y, operation):
if operation == u"conjunction":
return int(x and y)
elif operation == u"disjunction":
return int(x or y)
elif operation == u"implication":
return int(not x or y)
elif operation == u"exclusive":
return int((x + y) % 2)
elif operation == u"equivalence":
return int(x == y)
Jan. 9, 2017