set.isdisjoint() Disjoint?
Last updated: 2026-09-22
set.isdisjoint() Disjoint?
set.isdisjoint(other) returns True if sets have no common elements.
| Category | Set Methods |
|---|---|
| Kind | Built-in Type Method |
| Python Version | all |
📝 Syntax
set.isdisjoint(other)
⚙️ Parameters
| other Required | An iterable to compare with the set. |
|---|
Returns:bool, True if there are no common elements.
Mutates the original:No (returns a new object)
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
True
False
💡 Related Cases
More case studies coming soon — check back later.
❓ FAQ
QWhat does isdisjoint() check?
AWhether two sets have no common elements. {1, 2}.isdisjoint({3, 4}) returns True.
QIs the empty set disjoint with every set?
AYes; the empty set shares no elements with any set, so it returns True.
QCan the argument be any iterable?
AYes, it does not need to be a set.