bytearray()
Built-in FunctionPython 2.6+Advanced
Creates a mutable sequence of bytes
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.6+
Learn by Difficulty
Quick Example
python
ba = bytearray(b"hello") ba[0] = 72 print(ba)
bytearray() is a built-in function that creates a mutable sequence of bytes.
Try in PlaygroundTags
builtinfunctioncoredatatypebinarymutable