Those are lists, but if you really mean sets you can use the issubset method.
>>> s = set([1,2,3])
>>> t = set([1,2])
>>> t.issubset(s)
True
>>> s.issuperset(t)
True
For a list, you will not be able to do better than checking each element.
Those are lists, but if you really mean sets you can use the issubset method.
>>> s = set([1,2,3])
>>> t = set([1,2])
>>> t.issubset(s)
True
>>> s.issuperset(t)
True
For a list, you will not be able to do better than checking each element.