Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Meet Python Syntax and Errors

Marc Winterburn
Marc Winterburn
140 Points

Invalid character in identifier

After purposefully putting in the error of a P, I get a different errror message: invalid character in identifier. With a handy little arrow (or upward pointing chevron) directly below the o in hello. This also happened when I first attempted to run the script along with video 1.

Can you post a snapshot of your workspace where this error could be repeated?

Marc Winterburn
Marc Winterburn
140 Points

Having trouble with snapshot... Hereโ€™s a retyping: 1 print(โ€œHello, Marcโ€)

Console: treehouse:~/workspace$ python Hello.py File โ€œHello.pyโ€, line 1 print(โ€œHello, Marcโ€) ^ SyntaxError: invalid character in identifier treehouse:~/workspace$

1 Answer

You are seeing the error because of the use of curly quotes. Are you by chance typing this on your phone? If you change to straight quotes then the script executes as it should.

Marc Winterburn
Marc Winterburn
140 Points

Thank you very much Kris. I am using my tablet currently as a start but am looking to get a refurbed Mac air soon. Will look into keyboard settings. Again, many thanks