3 ответов
+ 3
ChaoticDawg:
'u' prefix for unicode string is only required for Python before version 3. Since Python3, strings are default unicode (and you need prefix litteral string with 'b' to define binary/ascii strings, wich are the default string type before version 3 ^^
Erik Johanson:
The function you are looking for is unichr() if you use Python before version 3: https://docs.python.org/2/library/functions.html#unichr
Else, for Python from version 3, you simply use the chr() function (as since Python3 it would work with unicode range values, what wasn't the case before)...
+ 3
Rafael Kohn:
To optimize the probabilities to get an accurate answer, I would suggest you to create a new thread with similar well formed question but tagged with the targeted language you need, as this one is specified about Python ( personnaly I don't well know C# and so I cannot help you... ) ;)
+ 2
If you just need to print it out all you need to do is have the unicode in the string like so:
print(u'\u002B') # outputs +
for multiples you just chain them together:
print(u'\u002B\u003E') # outputs +>
You can also store them in a variable and concatenate them to a string:
a = u'\u002B\u003E'
print("This string is concatenated to the unicode characters " + a)
More info:
https://docs.python.org/3/howto/unicode.html#the-unicode-type