Python: Cannot Assign Function Call
<p>I am having a "can't assign to call function" </p>

<p><code>invest()</code> is another defined function that works.</p>

<pre><code>def profile(initial_amount,startyear,endyear):
    subsequent_amount = 0
    for year in range(startyear,endyear-1):
        if year == startyear:
            print """&lt;table border="1"&gt;"""
            print "&lt;tr&gt;"
            print "&lt;td&gt;", year,"&lt;/td&gt;"
            print "&lt;td&gt;",initial_amount,"&lt;/td&gt;"
            print "&lt;/tr&gt;"
        elif year == startyear+1:
            print "&lt;tr&gt;"
            print "&lt;td&gt;",year+1,"&lt;td&gt;"
            print "&lt;td&gt;",invest(initial_amount,top_company(5,year,year+1),year),"&lt;td&gt;"
            invest(initial_amount,top_company(5,year,year+1)) = subsequent_amount
        else:
            print "&lt;tr&gt;"
            print "&lt;td&gt;",year+1,"&lt;td&gt;"
            print "&lt;td&gt;",invest(subsequent_amount,top_company(5,year,year+1),year),"&lt;td&gt;"
            invest(subsequent_amount,top_company(5,year,year+1)) = subsequent_amount
    print "&lt;/table&gt;"
</code></pre>

<p>How do I bypass this and make use of value of the function call?</p>

<p>Error: "There's an error in your program: can't assign to function call"</p>

<p>Error line:"invest(initial_amount,top_company(5,year,year+1)) = subsequent_amount"</p>

<p>Help!</p>
