I do not understand this issue where my printing does not work
b = (u'\u0648\u0627\u0646\u0627', 'NN')
print b[0]
Output
**Nothing is printed**
However this works
b = ("haha", "hehe")
print b[0]
Output
haha
asked Feb 6, 2015 at 6:15
aceminer
4,36512 gold badges62 silver badges110 bronze badges
2 Answers 2
The answer seems to be that it's Arabic script, which prints right-to-left, so you may have missed it on the right-hand side of your screen.
Also you may need to set your terminal or emulator to UTF-8.
answered Feb 6, 2015 at 6:29
John Zwinck
252k44 gold badges347 silver badges459 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Hey just check you have provided a wrong hexadecimal unicode
b = (u'\u068\u0627\u0646\u0627', 'NN')
^
3 digit hex try using
b = (u'\u0683\u0627\u0646\u0627', 'NN')
b[0]
prints right value as expected.
1 Comment
Antti Haapala
Obsolete answer generated from comment.
lang-py
b = (u'\u068\u0627\u0646\u0627', 'NN')assignment shows syntax error for me.\u068is not a valid Unicode escape sequence.