[Tutor] Leading zero for hex numbers

R. Alan Monroe amonroe at columbus.rr.com
Thu Dec 16 02:40:40 CET 2004


> print "0x%0X" % 12345

> displays
> 0x3039

> instead of 0x03039



>>> "%05x" % (12345,)
'03039'

>>> "0x%05x" % (12345,)
'0x03039'



More information about the Tutor mailing list