How to append values to bytearray in Python

1 Answer

0 votes
arr = bytearray()

arr.append(0)
arr.append(1)
arr.append(2)
arr.append(3)
arr.append(4)

print(arr)

'''
run:

bytearray(b'\x00\x01\x02\x03\x04')

'''

 



answered Sep 7, 2018 by avibootz

Related questions

...