Back to search

Bytes, bytearray, and range in Python

`bytes` is immutable binary data, `bytearray` is mutable binary data, and `range` is a memory-efficient arithmetic sequence object.

Python Medium Theory

Bytes, bytearray, and range in Python

`bytes` is immutable binary data, `bytearray` is mutable binary data, and `range` is a memory-efficient arithmetic sequence object.

  • Binary data is not text
  • bytearray supports in-place updates
  • range does not build a full list

Bytes, bytearray, and range in Python