Chapters
Python114 chapters

ReferenceSet methods

set.issubset()

Whether every item of the first set is in the second.

Signature

a.issubset(b) or a <= b

Parameters

NameMeans
banother set

Returns

A bool.

Example

Python
print({1, 2} <= {1, 2, 3})
print({1, 5} <= {1, 2, 3})
print({1, 5}.isdisjoint({2, 3}))

Output

True
False
True

See also