Going crazy...

Scott David Daniels Scott.Daniels at Acm.Org
Tue Jun 14 10:15:46 EDT 2005


Jan Danielsson wrote:
> Gary Herron wrote:
>>... a more recent addition to the language is Sets, ...
>>>>>from sets import Set
>>>>>Set([1,2,3,4,5,6]) - Set([2,3,6])
>>
>>Set([1, 4, 5])

If you are using 2.4 or later, you can simply use "set" without
importing anything.

     set(['apple', 'orange', 5]) - set([5])

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list