Number combinations

Boris Borcic bborcic at gmail.com
Wed Jul 19 11:33:02 EDT 2006


Tim Chase wrote:
...

> If you need the individual digits for something, you can use
> 
>     for i in xrange(0,10000):
>         d1,d2,d3,d4 = list("%04i" % i)

strings are sequences too, and you need only write

           d1,d2,d3,d4 = "%04i" % i



More information about the Python-list mailing list