the first line creates bytes objectthe character immediately before the string tells us that we are defining bytes object instead of normal unicode string within the stringeach byte is specified using--in this case-- hexadecimal number the \ character escapes within the byte stringand each say"the next two characters represent byte using hexadecimal digits provided we are using shell that understands the latin- encodingthe two print calls will output the following stringsb'clich\xe cliche the first print statement renders the bytes for ascii characters as themselves the unknown (unknown to asciithat ischaracter stays in its escaped hex format the output includes character at the beginning of the line to remind us that it is bytes representationnot string the next call decodes the string using latin- encoding the decode method returns normal (unicodestring with the correct characters howeverif we had decoded this same string using the cyrillic "iso - encodingwe' have ended up with the string 'clichshch'this is because the \xe byte maps to different characters in the two encodings converting text to bytes if we need to convert incoming bytes into unicodeclearly we're also going to have situations where we convert outgoing unicode into byte sequences this is done with the encode method on the str classwhichlike the decode methodrequires character set the following code creates unicode string and encodes it in different character setscharacters "clicheprint(characters encode("utf- ")print(characters encode("latin- ")print(characters encode("cp ")print(characters encode("ascii")the first three encodings create different set of bytes for the accented character the fourth one can' even handle that byteb'clich\xc \xa 'clich\xe 'clich\ traceback (most recent call last)