--- Steven Bethard <[EMAIL PROTECTED]> wrote:
> # print the first 100 primes
> for prime in itertools.islice(iter_primes(),
> 100):
> print prime
>
Sure. FWIW, in the example I posted, I kept the
output loop a little more pedestrian (using an
if/break idiom), and I printed primes less than 100,
not the first 100 primes.
I still find itertools a little magical at times, so I
want to keep it limited to places where it really
simplifies an algorithm.
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the
tools to get online.
http://smallbusiness.yahoo.com/webhosting
--
http://mail.python.org/mailman/listinfo/python-list