title: How to assign a variable in an IF condition, and then return it?
body: <pre><code>def isBig(x):
     if x &gt; 4: 
         return 'apple'
     else: 
         return 'orange'
  </code></pre>
  
  <p>This works:</p>
  
  <pre><code>if isBig(y): return isBig(y)
  </code></pre>
  
  <p>This does NOT work:</p>
  
  <pre><code>if fruit = isBig(y): return fruit
  </code></pre>
  
  <p>Why doesn't the 2nd one work!? I want a 1-liner. Except, the 1st one will call the function TWICE.</p>
  
  <p><em>How to make it 1 liner, without calling the function twice?</em></p>