[Tutor] List all possible 10digit number
dwightdhutto at gmail.com
Sat Sep 1 08:12:36 CEST 2012
I'm not sure what the point of any of that is; you're making a simple
> problem complex. If you're wanting to accomplish the task without using
> any of the itertools stuff, why not just:
> current = 10**9
> lim = 10**10
> while current < lim:
> print current #or write to file, or whatever
> current += 1
> Rough draft, in a hurry to try and help, and would have gotten a little
more zen elegance if it were for a client.
Plus the OP stated he needed a list. What's that list of ints for? Unless
this is benchmarking, they might be in need of an unordered list of ints in
which there are 10**9 different random values that need to have the
proverbial needle(or 2, or 3) in a hey stack found.
I thought there might be a reason, hopefully, other than trying to find the
max range you could count to.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor