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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:00
Which database model is best used for data warehouse and data mining
Answers: 3
question
Computers and Technology, 23.06.2019 04:40
The narrative structure of the popular movies can be broken down into
Answers: 3
question
Computers and Technology, 24.06.2019 11:30
Convert 11001110(acdd notation) into decimal
Answers: 2
question
Computers and Technology, 25.06.2019 04:00
What was the name of the first computer (machine) language?
Answers: 2
You know the right answer?
([source[, encoding[, errors]]])
return a new array of bytes. the bytearray class is a mutable...
Questions
question
Mathematics, 28.01.2020 21:59
Questions on the website: 13722363