0
\$\begingroup\$

In the image shown below, there says a syntax error at line 10. Its a basic If statement, i dont know why the syntax error shows up. Please advise Line 9 says syntax error. Will attach image of error also

error message

\$\endgroup\$
  • 1
    \$\begingroup\$ Did you cut and paste the code from a web page? If so, it’s possible your whitespaces are not ASCII tabs/spaces. Try deleting the spaces before the “if” and typing them again. \$\endgroup\$ – Blair Fonville Mar 17 '18 at 9:18
  • \$\begingroup\$ Oh yes i wrote it on notepad and copied onto my geedit via a pen drive. It worked! Thanks \$\endgroup\$ – user181557 Mar 17 '18 at 9:27
2
\$\begingroup\$

The octal \037777777640 values shown in the error appear to be interpretations of no-break spaces (which might come from copy-and-pasting from the web, for example). NBSP has a Hex value of 0xA0, which would equate to the octal values you’re seeing.

Try deleting all of your spaces and retyping them.

\$\endgroup\$
  • 1
    \$\begingroup\$ That must be a common error... \$\endgroup\$ – Solar Mike Mar 17 '18 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.