sets and subsets

Rich Krauter rmkrauter at yahoo.com
Wed Feb 11 16:10:52 EST 2004


# requires 2.3
>>> import sets
>>> a = [1,2,3,4,5]
>>> c = [2,4]
>>> b = list(sets.Set(a)-sets.Set(c))
>>> b
[1,3,5]

or

>>> for i in a:

Rich



__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html




More information about the Python-list mailing list