-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions_bytearray().py
More file actions
25 lines (18 loc) · 856 Bytes
/
Copy pathFunctions_bytearray().py
File metadata and controls
25 lines (18 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Python bytearray() Function
# Example
# Return an array of 4 bytes:
x = bytearray(4)
# Definition and Usage
# The bytearray() function returns a bytearray object.
# It can convert objects into bytearray objects, or create empty bytearray object of the specified size.
# Syntax
# bytearray(x, encoding, error)
# Parameter Values
# Parameter Description
# x A source to use when creating the bytearray object.
# If it is an integer, an empty bytearray object of the specified size will be created.
# If it is a String, make sure you specify the encoding of the source.
# encoding The encoding of the string
# error Specifies what to do if the encoding fails.
# Related Pages
# The bytes() Function