I want to the return the value of the statement if it evaluates to true. For example,
if f():
return f()
elif g():
return g()
The function may return a list also. since empty list evaluates to false, is there a better way to do it. I don't want to store the value outside the scope of the if statement.
f()if it is truthy (otherwiseg()), then you could usereturn f() or g(). The information in your question is not very clear.f()org()if they are not truthy (e.g. if neither of these things are true then I have to do some more work).