1. Overview
The issuperset() method returns True if a set has every elements of another set (passed as an argument). If not, it returns False.
Set X is said to be the superset of set Y if all elements of Y are in X.

Here, set B is a superset of set A and A is a subset of set B.
The syntax of issuperset() is:
A.issuperset(B)
The following code checks if A is a superset of B.
2. Return Value from issuperset()
issuperset() returns
- True if A is a superset of B
- False if A is not a superset of B
3. Example: How issuperset() works?
A = {1, 2, 3, 4, 5}
B = {1, 2, 3}
C = {1, 2, 3}
# Returns True
print(A.issuperset(B))
# Returns False
print(B.issuperset(A))
# Returns True
print(C.issuperset(B))
Output
True False True
If you need to check if a set is a subset of another set, you can useĀ issubset() in Python.
Related posts:
Python List reverse()
Python exec()
Python Tuple count()
Python String lstrip()
Python round()
Python repr()
Python Tuple index()
Python List count()
Python slice()
Python Program to Check If Two Strings are Anagram
Python Deeper Insights into Machine Learning - Sebastian Raschka & David Julian & John Hearty
Python String isidentifier()
Python Set issubset()
Python List clear()
Python Program to Convert Decimal to Binary, Octal and Hexadecimal
Python isinstance()
Python Dictionary popitem()
Python String count()
Python Program to Iterate Through Two Lists in Parallel
Python Program to Print all Prime Numbers in an Interval
Python Program to Append to a File
Python __import__()
Python Program to Trim Whitespace From a String
Python Set intersection()
Python String rstrip()
Python List Comprehension
Python Program to Convert String to Datetime
Python memoryview()
Python vars()
Python Program to Merge Two Dictionaries
Python Program to Find Armstrong Number in an Interval
Python Data Structures and Algorithms - Benjamin Baka