Forums

Hello World Syntax Error

I tried this from iPhone, didn’t see a way to attach a picture from my files.

Syntax error: invalid character in identifier

The arrow pointed to the O in Hello. Removed the letter. Then it pointed to the 2nd L in Hello. Tried various deletions and spacing, but still receiving error. Can anyone help?

If this one line won’t work, it leads me to believe nothing I create on the site will work.

I would say:

SyntaxError: Missing parentheses in call to 'print'

If you're getting "invalid character in identifier" errors, it's likely that Python isn't recognising the string you're entering as a string. Are you sure you're using proper quotes, " or ', and not "smart quotes"? That is likely to happen if (for example) you're copying/pasting from a word document or something like that.

Thx for ur reply. This was the Hello world tutorial on PythonAnywhere. I didn’t copy paste. And I made sure to include all punctuation

Print (“Hello, world.”)

Those quotes are indeed "smart quotes" -- you can see that because they're at an angle. Normal quotes will be vertical. If you delete them and replace them with normal " characters, then it will work. Are you coding on your phone, or on some other device that might replace normal quotes with different ones?