how do i get the value of a function i'm using in an if condition in python?
<p>how do i get the value of a function i'm using to trigger an if condition in python?</p>

<p>something like...</p>

<pre><code>def is_a_banana(a):
   if a == "Banana":
      return True
   else:
      return False

v = "Banana"

if ban = is_a_banana(v):
    print ban

&gt;&gt; True
</code></pre>

<p>i know i could just split it into...</p>

<pre><code>ban = is_a_banana(v)
if ban:
    print ban
</code></pre>

<p>but i'm trying to rewrite the following in an efficient way so that i can get the returned values of the functions out. in php i could just bind the output to a variable, is their any way to do this with python?</p>

<pre><code>if s.real_quick_ratio() &gt;= cutoff and \
   s.quick_ratio() &gt;= cutoff and \
   s.ratio() &gt;= cutoff:
    result.append((s.ratio(), x))
</code></pre>
