Rob Rob - 1 year ago 136
Python Question

calling an index in bytes

I'm experimenting with bytes in python 3 and I'm getting a strange result. When I convert a character to hex I get a predictable result.

ord('t') == 116
, which is equal to 7*16 + 4. This is reasonable since:

binascii.hexlify(b't') == b'74'

What I don't understand is why
b'74'[0] == 55
. Where is the 55 coming from?

Answer Source

b'74'[0] is '7'. Character '7' is 55 in ASCII

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download