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:
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python Program to Find All File with .txt Extension Present Inside a Directory
Python map()
Converting Between a List and a Set in Java
Python String rindex()
Python Function Arguments
Python pass statement
Python List remove()
Python all()
Python Program to Print the Fibonacci sequence
Python Program to Find the Largest Among Three Numbers
Python Set add()
Python while Loop
Python round()
Python Decorators
Python String zfill()
Python dict()
Python Program to Convert Decimal to Binary, Octal and Hexadecimal
Python Deep Learning - Valentino Zocca & Gianmario Spacagna & Daniel Slater & Peter Roelants
Python *args and **kwargs
Python String isupper()
Python frozenset()
Python id()
Python Program to Differentiate Between del, remove, and pop on a List
Python String isalnum()
Python Program to Get File Creation and Modification Date
Python String isnumeric()
Machine Learning Applications Using Python - Cases studies form Healthcare, Retail, and Finance - Pu...
Python Program to Make a Simple Calculator
Python help()
Python Program to Count the Number of Occurrence of a Character in String
Python Program to Copy a File