Content · Programming · Python

Python 3.15 Unicode Basics: Code Points, Text, and Encoding

Unicode assigns code points to characters used in writing systems around the world. Learn with a focused Python 3.15 example and a short practice exercise.

1 views Published Oct 17, 2026 Updated Oct 17, 2026 Admin

Unicode assigns code points to characters used in writing systems around the world.

How It Works


Python str values store text, while bytes represent encoded data. UTF-8 is a common encoding that turns Unicode text into bytes. ord() and chr() help inspect Unicode code points.

Example


letter = "é"
print(ord(letter))
print(chr(233))
print(letter.encode("utf-8"))

The outputs show code point 233, the character é, and its UTF-8 byte sequence.

Expected Output


233
é
b'\xc3\xa9'

Important Notes


A displayed character can consist of multiple Unicode code points; len(text) does not always equal visible glyph count.

Try It Yourself


Compare the character counts of two visually similar accent spellings.

Common Beginner Mistakes


  • A displayed character can consist of multiple Unicode code points; len(text) does not always equal visible glyph count.
  • Counting Unicode code points and assuming that always matches a user's visual character count.
  • Attempting to decode an arbitrary byte sequence without knowing its character encoding.

Key Takeaways


  • Unicode assigns code points to characters used in writing systems around the world.
  • Python str values store text, while bytes represent encoded data.
  • Unicode text and encoded bytes are different concepts; identify the encoding at boundaries.
Share this resourceSend this page to someone who may find it useful.