How to print 😁😛😋🤣☝✋✌❤👀👂👃👄👅👇👋👎💬😒😓😕😖😗😎😄💩😏😐😛😛😜😈💓💀👏👅☝😛😒🙉emojis in python, using python🐍
Everyone today do use emojis in one or the other ways on social media.
Being a programmer ,have you ever thought to write code that would give emojis in output?
It would be really fun right!!!
Python program to print Emojis
There are multiple ways we can print the Emojis in Python. Let’s see how to print Emojis with Uniocdes, CLDR names and emoji
module.
Using Unicodes:
Every emoji has a Unicode associated with it. Emojis also have a CLDR short name, which can also be used.
From the list of unicodes, replace “+” with “000”. For example – “U+1F600” will become “U0001F600” and prefix the unicode with “\” and print it.
Output:
You might think there will be big algorithm to print emojis😰🙄.But let me tell you ,it is not true,infact it is very easy to write code if you understand the emojis well.
By understanding the emojis well,I mean to understand how emojis represented or store in memory?
Everything in memory is store in binary format so the emojis are. It is very difficult for us to identify emojis in binary format . For this problem we have various encoding methods. Method used for encoding the emojis is Unicode .Every emojis have predefined encoded Unicode character.
So , we just need to use Unicode characters of emojis.
But it may be difficult to use Unicode characters of emojis.
Fortunately ,python have multiple way using which we can print emojis :
- Unicode
- CLDR names
- emoji module
Unicodes:
To use Unicodes , we need to replace “+” with “000” from the list of unicodes .
For example :
“U+1F600” will become “U0001F600” and prefix the unicode with “\” and print it.
CLDR names:
Emojis have CLDR short names which can also be used.
Using CLDR short name:
Output: