Unicode
Unicode allows Python strings to represent characters from different languages and symbols.
Key Points
- Python 3 uses Unicode by default.
- Supports emojis, special symbols, and international languages.
Example 1:
text = "नमस्ते"
print(text)
Output
नमस्ते
Example 2:
emoji = "😊"
print(emoji)
Output
😊
Example 3
print(ord("A"))
Output
65
Example 4
print(chr(65))
Output
A
Unicode Escape Sequence
heart = "\u2764"
print(heart)
❤