def emoji_counter(string):
no_of_emojis = 0
for char in string:
if char in emoji.UNICODE_EMOJI_ENGLISH:
no_of_emojis += 1
return no_of_emojis
I have written the above code. It works fine only for some emojis. But for a string like this "Oh, come on!!♂️" ( I am analyzing a whatsapp text )
The output for emoji_counter function is 4
When I copied the string to the one of the cells in my Jupyter Notebook, it shows extra two characters (a red dot and a gender symbol next to it). How can I fix this?
Thanks