def ifelse(test, if_true, if_false):
    """
    Return `if_true` is argument `test` evaluates to `True`,
    return `if_false` otherwise.

    This is just a workaround for Python 2.4 lack of the
    conditional assignment operator::

      >>> a = 1
      >>> b = ifelse(a, "yes", "no"); print(b)
      yes
      >>> b = ifelse(not a, 'yay', 'nope'); print(b)
      nope

    """
    if test:
        return if_true
    else:
        return if_false
