using encode(to encode the string encoded version of is stored in using ascii mapping encode('ascii'check if is converted to bytes or not if( == )print('encoding successful!'elseprint('encoding unsuccessful!'encoding successfulconverting bytes to text converting bytes to text is called the decoding this is implemented through decode(we can convert byte string to character string if we know which encoding is used to encode it so encoding and decoding are inverse processes python code to demonstrate byte decoding #initialise string 'tutorialspoint#initialising byte object 'tutorialspoint#using decode(to decode the byte object decoded version of is stored in using ascii mapping decode('ascii'