Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

python
communitycreator
unicodes

How to print emojis using Unicodes in python

Onyejiaku Theophilus Chidalu

Overview

An emoji is a pictogram, logogram, ideogram, or smiley embedded in the text and used in electronic messages and web pages. They can represent emotion, weather conditions, hand gestures, people, animals, objects, etc. They replace the conventional typographical style.

In python, emojis can be printed using their respective Unicodes. For example, the grinning face with big eyes emoji has a Unicode of U+1F603. When using such a Unicode in our code, we replace the “+” with “000” so that U+1F603 becomes U0001F603.

Printing emojis using Unicode

  • Step 1: Replace the “+” with “000” in any of the Unicodes.
  • Step 2: Prefix the Unicode with “” and print.

Now, we will print different emojis using their corresponding Unicodes.

Code

# for the grinning face with big eyes
print ('\U0001F603')
# for the winking face 
print('\U0001F609')
# for the kissing face
print('\U0001F617')	

Output

😃
😉
😗

Every emoji has a corresponding Unicode.

RELATED TAGS

python
communitycreator
unicodes

CONTRIBUTOR

Onyejiaku Theophilus Chidalu
RELATED COURSES

View all Courses

Keep Exploring