[Tutor] Hex conversion strangeness

Andrew Robert andrew.arobert at gmail.com
Thu May 25 00:11:31 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Everyone,

I am trying to understand conversion of a value to hex.

Could you please confirm that what I am doing is right?

Get the hex value of ! and store it in a

a=hex(ord('!'))
print a
0X21

I see examples including this kind of a statement but I am not sure why.

int(a,16)
33

If the 0X21 is the actual hex value, then why convert to integer?

Is this the ASCII table reference to the hex value?


- --
Thank you,
Andrew Robert
Systems Architect
Information Technologies
MFS Investment Management
Phone:   617-954-5882

E-mail:  arobert at mfs.com
Linux User Number: #201204
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)

iD8DBQFEdNoTDvn/4H0LjDwRAp6yAKC5wI55jX5BJeu89ahj55hA7i8eAQCgu2Op
rVbo0kgQ9GQv8N0TB34StlY=
=pe50
-----END PGP SIGNATURE-----


More information about the Tutor mailing list