On Jun 11, 10:29 am, casebash <walkr...@gmail.com> wrote: > Sorry, I didn't quite make it clear. The issue isn't about limiting > the length (as I won't be using integers bigger than this). The > problem is that sometimes the output is shorter.
Is this what you're looking for? Python 2.6.2 (r262:71600, Jun 8 2009, 14:57:27) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> '{0:032b}'.format(12345) '00000000000000000011000000111001' Mark -- http://mail.python.org/mailman/listinfo/python-list