Search notes:
Python: bytes (type)
The
bytes
type is a
sequence
type.
Instances of
bytes
are represented with the
b'…'
literal.
hex()
hex()
returns a hexadecimal representation of the bytes object:
>>> b'ABC'.hex() '414243'
The returned type is
str
. Compare with
binascii.hexlify()
.
See also
The
bytes
built-in function
The
.encode()
method of the
string
object.
Other
Built-in types
Index