sets and subsets

Rich Krauter rmkrauter at yahoo.com
Wed Feb 11 16:28:38 EST 2004


> How do I test set c to find what it contains and
then look at set b to 
> see if it contains any of those same numbers, and if
so, remove them.

Sorry, I hit something and it sent the last message
before I was finished:

use sets module, or 

>>> b = []
>>> for item in a:
>>> ... if item not in c:
>>> ...    b.append(i)  

You may want to review the properties of lists. A
quick skim of the docs every once in a while has done
me a lot of good.

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