On Nov 4, 10:02 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Nov 4, 1:26 pm, Gilles Ganault <[EMAIL PROTECTED]> wrote: > > > On Tue, 4 Nov 2008 11:22:27 -0800 (PST), Aaron Brady > > > <[EMAIL PROTECTED]> wrote: > > >> for i=01 to 99 except 04, 34, 40, 44, 48, 54, 57, 67, 76, 83, 89: > > > >sorted( list( set( domain ) - set( exceptions ) ) ) > > > >Set subtraction. > > > Thanks a lot but... I don't know what the above means :-/ > > This example produces the numbers 0..9, except 3, 5, and 9. > > >>> sorted( list( set( range( 10 ) ) - set( [ 3, 5, 9 ] ) ) ) > > [0, 1, 2, 4, 6, 7, 8]
FYI, 'set' accepts an iterable, so you don't need 'list': >>> sorted(set(range(10)) - set([3, 5, 9])) [0, 1, 2, 4, 6, 7, 8] -- http://mail.python.org/mailman/listinfo/python-list