Back to search

Escape sequences, Unicode, encoding, and decoding in Python

Python strings are Unicode text, while bytes are encoded binary data that must be encoded or decoded at boundaries.

Python Medium Theory

Escape sequences, Unicode, encoding, and decoding in Python

Python strings are Unicode text, while bytes are encoded binary data that must be encoded or decoded at boundaries.

  • Escapes like `\n` and `\t` are special characters
  • Unicode represents text code points
  • Encoding converts text to bytes and decoding converts bytes to text

Escape sequences, Unicode, encoding, and decoding in Python