Building loop with some exceptions?

Gilles Ganault nospam at nospam.com
Fri Nov 7 03:06:27 EST 2008


On Tue, 4 Nov 2008 15:55:06 -0800 (PST), alex23 <wuwei23 at gmail.com>
wrote:
>  exclusions = [04, 34, 40, 44, 48, 54, 57, 67, 76, 83, 89]
>  for i in (x for x in xrange(1,100) if x not in exclusions):

Thanks guys.



More information about the Python-list mailing list