Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Python: bytearray: Return mutable array of bytes

‘bytearray’ method take an object and return a Mutable bytes array.

 

Signature

bytearray([source[, encoding[, errors]]])

 

byte_array_1.py

even_numbers = [2, 4, 6, 8]

byte_array = bytearray(even_numbers)
print(byte_array)

 

Output

bytearray(b'\x02\x04\x06\x08')

 

 

  

Previous                                                    Next                                                    Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Python: bytearray: Return mutable array of bytes

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×