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 trialAngela Anders
1,844 Pointscraigs_lunch
I'm getting the following when I try to run an example in the training through the console. Is there a reason why I cannot get the emoji taco to show up like on the video?
treehouse:~/workspace$ python -i wishlist.py
Suggested gift: Learning Python: Powerful Object-Oriented Programming - Mark Lutz
craigs_lunch = "\N(TACO)"
File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-1: malformed \N character escape
Steven Parker
231,271 PointsYour issue was different, the decoding was working but it did not display.
3 Answers
Steven Parker
231,271 PointsNamed escapes should have the name enclosed in braces instead of parentheses.
So instead of "\N(TACO)"
, try: "\N{TACO}"
.
Angela Anders
1,844 PointsOkie dokie. Makes sense. Thanks
Angel Miranda
2,434 Pointsdoes this example only work with TACO? I tried mikes_lunch = "\N{PIZZA}"but it tells me that its a unicode error. wanted to test the potential of this.
Steven Parker
231,271 PointsPerhaps just the name is the issue, try the unicode: mikes_lunch = "\U0001f355"
As a last resort you could also cut and paste the actual character 🍕
<noob />
17,062 Points<noob />
17,062 PointsAngela Anders Hi :], i asked the same question and it appears that your computer does not support this. see this discussion; https://teamtreehouse.com/community/just-wanted-to-ask-why-i-dont-get-the-taco-emoji