def ifelse(condition, trueValue, falseValue):
    """
    :param condition:   Flag
    :param trueValue:   Return value if flag is True
    :param falseValue:  Return value if flag is False
    :type  condition:   Flag (bol value) True/False
    :return:            trueValue if condition is True, FalseValue otherwise

    Example:

    >>> from m2py import functional as f
    >>>
    >>> x = 3
    >>>
    >>> f.ifelse(x> 2, x**2, x-10)
    9
    >>> x= 1
    >>> f.ifelse(x> 2, x**2, x-10)
    -9
    >>> x= 2
    >>> f.ifelse(x> 2, x**2, x-10)
    -8
    >>>

    """
    return [falseValue, trueValue][condition]