Problem scenario
You are running a Python script. You keep getting “SyntaxError: invalid syntax” and a line number. You can find nothing wrong with the syntax on the specified line number. What do you do?
Possible solution #1
Look at the line with code, as opposed to blank line(s), above it. Is there a missing quote, brace, bracket or parentheses?
Possible solution #2
Are you trying to use an “if” statement on one line?
…
Continue reading “How Do You Troubleshoot “SyntaxError: invalid syntax” in Python?”