Articles → PYTHON → Bytearray In Python
Bytearray In Python
What Is Bytearray?
Syntax
bytearray(size)
Or
bytearray(b’string’)
Example
size = 5
arr = bytearray(size)
print(arr)
Output
Click to Enlarge
The Second Example
arr = bytearray(b"Test")
print(arr)
Output
Click to Enlarge