def isBig(x): if x > 4: return \'apple\' else: return \'orange\'
This works:
if isBig(y): return isBig(y)
Starting Python 3.8, and the introduction of assignment expressions (PEP 572) (:= operator), it's now possible to capture the condition value (isBig(y)) as a variable (x) in order to re-use it within the body of the condition:
Python 3.8
:=
isBig(y)
x
if x := isBig(y): return x