python check if list contains elements of another list

36

python check list contains another list -

>>> items = set([-1, 0, 1, 2])
>>> set([1, 2]).issubset(items)
True
>>> set([1, 3]).issubset(items)
False

Comments

Submit
0 Comments