Import binascii A = B ' worker ' # b'worker ' B = binascii.b2a_hex (A) # bin to hex # b'776f726b6572' C = binascii.a2b_hex (B) # converted into a binary hexadecimal # B 'worker' D = binascii.hexlify (A) # bin to hexadecimal E = binascii.unhexlify (B) # 16 hexadecimal is converted into binary # b'worker ' Print (A, B, C, D, E)