convert_text_to_hexadecimal_viva.py in python

38

# convert text string to hexa decimal code
str = 'twee'.encode('utf-8')
hex = str.hex()

# convert hexadecimal code to string
str1 = bytes.fromhex(hex).decode('utf-8')

print(hex)
print(str1)

Comments

Submit
0 Comments