How to convert bytearray into a string in Python

1 Answer

0 votes
arr = bytearray(b"python")

s = arr.decode("ascii")

print(arr)
print(s)

'''
run:

bytearray(b'python')
python

'''

 



answered Sep 7, 2018 by avibootz
...