The icons in the print() statements β like π, β
, π« β are Unicode emojis. Python (especially Python 3) supports printing Unicode characters, including emojis, directly to the console β as long as the terminal or console supports Unicode (which most modern terminals do).
π Here’s how it works:
Python
print("π Welcome to the Number Guessing Game!")You’re actually inserting a Unicode emoji character (π = U+1F389) as part of the string. Python sees it just like any other string character and prints it.
β No special library needed
You donβt need to import any emoji or Unicode library β these are just standard Unicode characters inside your strings.
β οΈ Terminal Support
While this works out-of-the-box on:
- macOS Terminal
- Linux terminal
- Windows Terminal / PowerShell (modern versions)
- VS Code terminal
- PyCharm terminal
β¦some older terminals might not display the emoji correctly and may show boxes or question marks instead.