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


Picture showing the byte array with null values in python



The Second Example


arr = bytearray(b"Test")
print(arr)



Output


Picture showing the output of the byte array in python



Posted By  -  Karan Gupta
 
Posted On  -  Friday, May 3, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250