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 Program to Print the Fibonacci sequence
Python Program to Check If Two Strings are Anagram
Python ord()
Python List append()
Python help()
Python Dictionary
Python Namespace and Scope
Python Program to Make a Simple Calculator
Python Program to Display Powers of 2 Using Anonymous Function
Python Errors and Built-in Exceptions
Python Program to Check if a Key is Already Present in a Dictionary
Python Program to Find the Factorial of a Number
Python Program to Create a Countdown Timer
Python enumerate()
Python Program to Catch Multiple Exceptions in One Line
Python Data Types
Python Input, Output and Import
Python String expandtabs()
Python Set discard()
Python String casefold()
Python complex()
Python Data Analytics with Pandas, NumPy and Matplotlib - Fabio Nelli
Python List index()
Python Operator Overloading
Python List sort()
Python reversed()
Python staticmethod()
Learning scikit-learn Machine Learning in Python - Raul Garreta & Guillermo Moncecchi
Python Tuple count()
Python String capitalize()
Python Program to Find Numbers Divisible by Another Number
Python Program to Find Hash of File