Tim Chase wrote:
...
> If you need the individual digits for something, you can use
>
> for i in xrange(0,1):
> d1,d2,d3,d4 = list("%04i" % i)
strings are sequences too, and you need only write
d1,d2,d3,d4 = "%04i" % i
--
http://mail.python.org/mailman/listinfo/pytho
placid <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Just wondering if there is a better way of generating a 4 digit number
> (that gets converted to a string), ive got the following code which
> generates strings between -.
>
>
>
> for a in range(0,10):
> for b in range(0,10):
>
placid wrote:
> Hi all,
>
> Just wondering if there is a better way of generating a 4 digit number
> (that gets converted to a string), ive got the following code which
> generates strings between -.
>
>
>
> for a in range(0,10):
> for b in range(0,10):
> for c in range(0,10
How about
print ["%04d" % x for x in xrange(1)]
--
http://mail.python.org/mailman/listinfo/python-list
> Just wondering if there is a better way of generating a 4 digit number
> (that gets converted to a string), ive got the following code which
> generates strings between -.
>
>
>
> for a in range(0,10):
> for b in range(0,10):
> for c in range(0,10):
> for d in r
Hi all,
Just wondering if there is a better way of generating a 4 digit number
(that gets converted to a string), ive got the following code which
generates strings between -.
for a in range(0,10):
for b in range(0,10):
for c in range(0,10):
for d in range(0,10):