bytes.len
bytes.len
Function
Returns the length in bytes of Bytes.
Syntax
bytes(value).len()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Int | Number of bytes. |
Code Example
data = bytes([66, 84]) result = data.len() // Output: 2 print result
Notes
-
len()counts raw bytes, not the number of characters.