Invalid Syntax Bug



From a certain line on-wards, in my IDE, I get a syntax error for no apparent reason. Starting from a line where I attempt a simple check:

if cash < (price*shares):
return apology(“Insufficient funds”)

If I comment out the first line of code shown, the syntax error moves to the next line, and so on. This problem is very confusing and I am not sure how to deal with it.

Please note line 59. Thanks for any help!


As far as I can tell, the problem is not line 59. Rather, it is that on line 57, you did not close your parentheses. The way that Cloud9 performs syntax checking makes it think you are still adding parameters to line 57, just on a different line, and so the errors can sometimes be misleading.