shortened for brevity) 'spamb find( 'pa' bbytes literal replace( 'pa' 'xy' 'sxymbytes methods expect bytes arguments split( 'pa'[ ' ' ' 'bytes methods return bytes results 'spamb[ 'xtypeerror'bytesobject does not support item assignment one notable difference is that string formatting works only on str objects in xnot on bytes objects (see for more on string formatting expressions and methods)'% ' '% typeerrorunsupported operand type(sfor %'bytesand 'int'{ }format( ' '{ }format( attributeerror'bytesobject has no attribute 'formatsequence operations besides method callsall the usual generic sequence operations you know (and possibly lovefrom python strings and lists work as expected on both str and bytes in xthis includes indexingslicingconcatenationand so on notice in the following that indexing bytes object returns an integer giving the byte' binary valuebytes really is sequence of -bit integersbut for convenience prints as string of ascii-coded characters where possible when displayed as whole to check given byte' valueuse the chr built-in to convert it back to its characteras in the followingb 'spamb 'spama sequence of small ints prints as ascii characters (and/or hex escapesb[ [- indexing yields an int chr( [ ]'sshow character for int unicode and byte strings