[Tutor] List all possible 10digit number

eryksun eryksun at gmail.com
Sat Sep 1 07:20:55 CEST 2012


On Sat, Sep 1, 2012 at 12:29 AM, Scurvy Scott <etanes.rm at gmail.com> wrote:
>
> The while loop works for simply printing. Now I'm trying to save to a file
>
> I = 1000000000
> Boogers = raw_input("file")
> Baseball = open(Boogers)

As ASCII, that's 11 bytes per number times 9 billion numbers. That's
approximately 92 GiB (about 21 DVD-5 discs). Are you sure you want to
do that?

Minor correction:

>>    counter = count(start=10**9L)
>>    slices = (islice(counter, 10**9) for i in range(10))
>>    nums = chain.from_iterable(slices)

That should have been range(9), not range(10).


More information about the Tutor mailing list