Skip to content

EXCLUSIVE_OR

Download Flojoy Studio to try this app
Takes two boolean data type and computs logical EXCLUSIVE OR operation on them. Params: default : Boolean The input boolean to which we apply the EXCLUSIVE OR operation. a : Boolean The input boolean to which we apply the EXCLUSIVE OR operation. Returns: out : Boolean The boolean result from the operation of the inputs.
Python Code
from flojoy import flojoy, Boolean


@flojoy
def EXCLUSIVE_OR(default: Boolean, a: Boolean) -> Boolean:
    """Takes two boolean data type and computs logical EXCLUSIVE OR operation on them.

    Parameters
    ----------
    default : Boolean
        The input boolean to which we apply the EXCLUSIVE OR operation.
    a : Boolean
        The input boolean to which we apply the EXCLUSIVE OR operation.

    Returns
    -------
    Boolean
        The boolean result from the operation of the inputs.
    """
    if (default.b and not a.b) or (not default.b and a.b):
        return Boolean(b=True)
    return Boolean(b=False)

Find this Flojoy Block on GitHub

Example App

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, BOOLEAN nodes generate true values. It applies EXCLUSIVE_OR operation on them.

Visualize it with TEXT_VIEW node.