A and B but not C in list

Ian Kelly ian.g.kelly at gmail.com
Sun Jan 23 22:05:49 EST 2011


On Sun, Jan 23, 2011 at 2:34 PM, Christian Heimes <lists at cheimes.de> wrote:
> your_set = set(your_list)
>
> if your_set.issuperset(set([A, B])) and your_set.isdisjoint(set([C, D])):

if your_set.intersection([A, B, C, D]) == set([A, B]):
    ...

Cheers,
Ian



More information about the Python-list mailing list