Search notes:

Python: bytearray (type)

The bytearray type is similar to bytes but allows modifications:
ba = bytearray(bytes('Renè', encoding='utf-8'))
print(str(type(ba))
print(ba.decode('utf-8'))  # Renè
ba[4] = 169
print(ba.decode('utf-8'))  # René

See also

The bytearray built-in function
Other Built-in types such as

Index