Displaying Special Characters Using Unicode

Question:

I want to know how to type a special character "Cherry" like the fruit. I got the Unicode string and attempted to display it, but for some reason it sees the 2 within u1F352 as part of the string and not the Unicode sequence, so it displays something completely different: ἵ2.

import sys
print('u1F352')
Asked By: Jojo

||

Answers:

Using the unicode escape:

>>> print("U0001F352")
 

Using the unicode name:

>>> print("N{cherries}")
 

Using the codepoint:

>>> print(chr(0x1f352))
 
Answered By: wim
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.