[Tutor] Leading zero for hex numbers

Orri Ganel singingxduck at gmail.com
Thu Dec 16 02:46:21 CET 2004


On Wed, 15 Dec 2004 20:40:40 -0500, R. Alan Monroe
<amonroe at columbus.rr.com> wrote:
> > print "0x%0X" % 12345
> 
> > displays
> > 0x3039
> 
> > instead of 0x03039
> 
> 
> >>> "%05x" % (12345,)
> '03039'
> 
> >>> "0x%05x" % (12345,)
> '0x03039'
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 

My mistake . . . the "." I entered was unnecessary.

-- 
Email: singingxduck AT gmail DOT com
AIM: singingxduck
Programming Python for the fun of it.


More information about the Tutor mailing list