Inconsistency in hex()

Paul Rubin http
Wed Jul 13 23:57:54 EDT 2005


Steven D'Aprano <steve at REMOVETHIScyber.com.au> writes:
> >>> hex(75)
> '0x4b'
> >>> hex(75*256**4)
> '0x4B00000000L'
> 
> By accident or design? Apart from the aesthetic value that lowercase hex
> digits are ugly, should we care?

Use ('%x' % 75) or ('%X' % 75) if you care.



More information about the Python-list mailing list