Bytearray Methods

bytearray.lower()

Map uppercase ASCII letters A–Z to a–z, preserving all other bytes. This is useful for case-insensitive ASCII tokens; UTF-8 letters outside ASCII are not lowercased. For multilingual case conversion decode to str first. Returns a new mutable buffer even when no changes are needed; the original is untouched. These operations are intended for ASCII-compatible data, not arbitrary binary formats.

Formal Syntax & Structure

python syntaxpython
data.lower()

Return Value

bytearray

bytearray containing the transformed byte values; receiver unchanged.

Working Example

Example Snippetpython
data = bytearray(b'API-Ready 7')result = data.lower()print(result)print(bytearray(b'\xc3\x89Z').lower())print(data)print(result is data)
Python Reference