def isBig(x):
if x > 4:
return 'apple'
else:
return 'orange'
This works:
if isBig(y): return isBig(y)
This does NOT work:
if fruit = isBig(y): return fruit
Why doesn't the 2nd one work!? I want a 1-liner. Except, the 1st one will call the function TWICE.
How to make it 1 liner, without calling the function twice?