return command doesn't return a variable--python
<p>when I do <code>return variable</code> in my function it doesn't return it,
when I <code>print(variable)</code> it prints what it should print/return</p>

<p>The function calls some other functions and calls itself(there are two main parts, if statement(then return the variable), and an elif statement (then call itself))</p>

<p>What might be the problem </p>

<p>Thanks</p>

<p>code:
in the elif part it calls itself, i didn't write that part</p>

<pre><code>function(parameter):

     temp=[]
     if ((max(sample_list)/sum(sample_list))&gt;= (0.5)):
           winner_index=sample_list.index(max(sample_list))
           winner=DICTIONARY[winner_index]
           #print(winner)
           return winner

     elif ((max(sample_list)/sum(sample_list))&lt;= (0.5)):
          for index in LIST:
             name=DICTIONARY.get(index)
             if name not in lost_list:
                 temp.append(sample_list[index])
          MINIM=min(temp)
          party_in=sample_list.index(MINIM)
          party_name=DICTIONARY.get(party_in)
          lost_list2=another_function(lost_list,party_name)
          new_parameter=different_function(parameter,lost_list2)
          function(new_parameter)
</code></pre>
