Problem Statement
When processing binary data in place, which type is appropriate?
Explanation
bytes is immutable. bytearray is mutable and lets you edit binary data without creating new objects.
For zero-copy slicing of existing buffers, wrap with memoryview to avoid extra allocations.
Code Solution
SolutionRead Only
buf = bytearray(b'ABC') buf[0]=97 # a
