On Sun, Dec 13, 2009 at 12:10 PM, Carsten Haese <carsten.ha...@gmail.com>wrote:
> Victor Subervi wrote: > > I need to get at the individual elements of the set (that which is > > between the single quotes). > > It's not quite clear what you mean by "get at the individual elements", > so I'll just show you a couple of things you can do to a set, and maybe > one of them comes close to what you need: > > >>> from sets import Set > >>> aSet = Set(['Small', 'Extra-small', 'Medium']) > > Do something for each element: > > >>> for element in aSet: > ... print element > ... > Small > Extra-small > Medium > > Convert the set to list: > > >>> list(aSet) > ['Small', 'Extra-small', 'Medium'] > > Test membership in the set: > > >>> 'Small' in aSet > True > >>> 'Banana' in aSet > False > > Carsten, thank you (once again ;) for your patience. I didn't know I had to import something. Thanks again, V
-- http://mail.python.org/mailman/listinfo/python-list