On Tue, Nov 4, 2008 at 2: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 :-/ > -- > domain = xrange(100) # this is all of the numbers exceptions = [04,34,40,44,48,54,57,67,76,83,99] #this is the stuff you don't want new_set = set(domain) - set(exceptions) # removes all of the stuff in exceptions from the domain new_list = sorted(list(new_set)) : turns the set into a list and then sorts it. Calling sorted ensures that the list is in ascending order for i in new_list : #new_list just contains the stuff you need. > > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list