Hello,
why not using the filter function?

for x in filter(is_prime, range(100)):
    # do something with x

This is equivalent as was mentionned at first:

    for x in range(100) if is_prime(x):
        # do things with x

Régis

--
Régis  Martin
Directeur de Projets Astek Industrie
Tel: 06-83-53-15-05
http://www.groupeastek.com/

<<attachment: rmartin.vcf>>

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to