Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Boolean Algebra by MaciejKrasny
OPERATION_NAMES = ("conjunction", "disjunction", "implication", "exclusive", "equivalence")
def boolean(x, y, operation):
if operation=="conjunction":
result = x and y
elif operation=="disjunction":
result = x or y
elif operation =="implication":
result= not x or y
elif operation =="exclusive":
result = x^y
elif operation=="equivalence":
result= x==y
return int(result)
Nov. 25, 2016