This line in my program:
invest(initial_amount,top_company(5,year,year+1)) = subsequent_amount
causes me to get this error:
You are assigning to a function call:
invest(initial_amount,top_company(5,year,year+1)) = subsequent_amount
which is illegal in Python. The question is, what do you want to do? What does invest() do? I suppose it returns a value, namely what you're trying to use as subsequent_amount, right?
If so, then something like this should work:
amount = invest(amount,top_company(5,year,year+1),year)