What is the difference between the meaning of 0x and x in Python hex strings?

What is the difference between the meaning of 0x and x in Python hex strings?

0x is used for literal numbers. x is used inside strings to represent a character

>>> 0x41
65
>>> x41
A

>>> x01 # a non printable character
x01

0x follows number, means HEX number

x follows number, means HEX ascii characters

check it here:
ascii table

What is the difference between the meaning of 0x and x in Python hex strings?

Leave a Reply

Your email address will not be published.