Unicode Reference
Python 3 strings are fully Unicode by default. While ASCII (0-127) is sufficient for most interview questions, some string questions involve wider Unicode concepts.
1. ord() and chr()
These work exactly the same for Unicode as they do for ASCII.
2. String Length
In Python 3, len() returns the number of Unicode code points, not the number of bytes.
3. Checking Character Types
Python's built-in string methods handle Unicode cleanly.
"123".isnumeric() # True
"١٢٣".isnumeric() # True (Arabic numerals)
"Ⅷ".isnumeric() # True (Roman numeral 8)
"abc".isalpha() # True
"ñ".isalpha() # True
4. Encoding and Decoding
If a problem explicitly asks you to deal with bytes (e.g., "Design a compression algorithm" or "Network serialization"):