[ ' '[ bytearray( 'xyam'or index byte string processing bytearray objects borrows from both strings and listssince they are mutable byte strings while the byterrray' methods overlap with both str and bytesit also has many of the list' mutable methods besides named methodsthe __iadd__ and __setitem__ methods in bytearray implement +in-place concatenation and index assignmentrespectivelyin bytes but not bytearray set(dir( 'abc')set(dir(bytearray( 'abc')){'__getnewargs__'in bytearray but not bytes set(dir(bytearray( 'abc'))set(dir( 'abc'){'__iadd__''reverse''__setitem__''extend''copy''__alloc__''__delitem__''__imul__''remove''clear''insert''append''pop'you can change bytearray in place with both index assignmentas you've just seenand list-like methods like those shown here (to change text in place prior to you would need to convert to and then from listwith list(strand 'join(list)--see and for examples)mutable method calls bytearray( 'xyam' append( 'lmn'typeerroran integer is required requires string of size append(ord(' ') bytearray( 'xyaml' extend( 'mno' bytearray( 'xyamlmno'all the usual sequence operations and string methods work on bytearraysas you would expect (notice that like bytes objectstheir expressions and methods expect bytes argumentsnot str arguments)sequence operations and string methods bytearray( 'xyamlmno' '!#bytearray( 'xyamlmno!#' [ unicode and byte strings