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
Renee Rhodes
10,653 PointsInvalid character in identifier
Im working on the Managing Keys video and I keep getting aneroid in the workspaces console:
my_dict2 = {'first': 'red', 'third': ‘yellow'}
File "<stdin>", line 1
my_dict2 = {'first': 'red', 'third': ‘yellow'}
^
SyntaxError: invalid character in identifier
(the carat actually appears under the "w" in 'yellow'.)
previously, the error was indicated for another key, which was 'second': 'blue' (and was in between the first and third)
When I removed second, the error jumped t indicate the '"w" in yellow.
I don't see any difference between my syntax and what appears in the video.
2 Answers
Sara Chicazul
7,475 PointsIf I copy and paste your code, one of the quotes comes up as a 'smart quote' and is flagged as an error by Workspaces. Only the regular, straight quotes are acceptable string delimiters. It can be hard to see the difference in some fonts!
man odell
1,905 Pointsmy_dict2 = {'first': 'red', 'third': ‘ * yellow'} i put star before your 'yellow' variable and < it is not quotation mark u should change it to single quotation
Renee Rhodes
10,653 PointsRenee Rhodes
10,653 PointsThat's ridiculous, since this wasn't an issue like ten minutes before. But...it fixed it, so I guess that's what matters. Thanks!