Python 3 reference · Set Methods
Python Set issuperset() Method
Return True if this set contains every element of the other. The same as a >= b.
Python 3 Since 3.0
Syntax
set.issuperset(other)
Parameters
| Parameter | Description |
|---|---|
other |
An iterable. |
Return value
True or False.
Examples
print({1, 2, 3}.issuperset({1, 2}), {1, 2} >= {1, 3})
Output
True False
user_perms = {"read", "write", "delete"}
print(user_perms.issuperset(["read", "write"]))
Output
True
Version history
| Version | Change |
|---|---|
| Python 3.0 | Added |
Related
set.issubset()· Return True if every element of this set is also in the other. The same as a <= b.- Python Sets · tutorial