[Solved] “Syntax error: expecting rightparen before not.”


It appears that your issue is happening because you have a space between “!” and “=” on all of the lines that you tagged. You’re attempting to use the inequality operator, which is “!=”, or an exclamation mark followed by an equals sign with no space.

When you have the exclamation mark by itself, it is interpreted as a “logical not” and the error message that you’re getting is because the compiler is trying to make its best guess at what you’re trying to do.

If you remove all of the spaces between “!” and “=” then this error should be taken care of.

solved “Syntax error: expecting rightparen before not.” <- I looked around, but I can't explain why this appears