You can index into a tuple:
(falseValue, trueValue)[test]
test needs to return True or False.
It might be safer to always implement it as:
(falseValue, trueValue)[test == True]
or you can use the built-in bool() to assure a Boolean value:
(falseValue, trueValue)[bool(<expression>)]