SyntaxError: "can't assign to function call"


Question

This line in my program:

invest(initial_amount,top_company(5,year,year+1)) = subsequent_amount

causes me to get this error:

SyntaxError: can't assign to function call

How do I fix this and make use of value of the function call?

1
14
1/1/2017 10:26:40 PM

Syntactically, this line makes no sense:

invest(initial_amount,top_company(5,year,year+1)) = subsequent_amount

You are attempting to assign a value to a function call, as the error says. What are you trying to accomplish? If you're trying set subsequent_amount to the value of the function call, switch the order:

subsequent_amount = invest(initial_amount,top_company(5,year,year+1))
18
5/11/2011 1:27:21 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon