subject

([source[, encoding[, errors]]])
return a new array of bytes. the bytearray class is a mutable sequence of integers in the range 0 < = x < 256. it has most of the usual methods of mutable sequences, described in mutable sequence types, as well as most methods that the bytes type has, see bytes and bytearray operations.

the optional source parameter can be used to initialize the array in a few different ways:

if it is a string, you must also give the encoding (and optionally, errors) parameters; bytearray() then converts the string to bytes using str.
if it is an integer, the array will have that size and will be initialized with null bytes.
if it is an object conforming to the buffer interface, a read-only buffer of the object will be used to initialize the bytes array.
if it is an iterable, it must be an iterable of integers in the range 0 < = x < 256, which are used as the initial contents of the array.
without an argument, an array of size 0 is created.

see also binary sequence types — bytes, bytearray, memoryview and bytearray objects.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, ozzy55
Create a word problem that involves calculating the volume and surface area of a three-dimensional object. cube: surface area 6 s2 , volume s3
Answers: 3
image
Computers and Technology, 23.06.2019 00:00, brooklyn4932
What engine component is shown in the above figure?
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, teamroper35
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
Answers: 1
image
Computers and Technology, 23.06.2019 21:00, tiffg2588
Will this setup result in what kathy wants to print?
Answers: 2
You know the right answer?
([source[, encoding[, errors]]])
return a new array of bytes. the bytearray class is a mutable...

Questions in other subjects: