Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print red heart in python 3

I need to print the red heart emoji ❤️️ with unicode in Python 3 but it has two unicodes (\U00002764 and \U0000FE0F). How am I suppose to print it?

For example, a green heart is print("\U0001F49A")

like image 288
David W Avatar asked Jan 24 '23 17:01

David W


1 Answers

Neither of the two unicodes worked for me - they both printed black hearts. The red heart requires combining the two unicodes:

print("\u2764\uFE0F")

Explanation for why it requires two unicodes can be found here.

like image 154
Akanksha Atrey Avatar answered Jan 29 '23 15:01

Akanksha Atrey