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 copy()
Python List
Python Program to Multiply Two Matrices
Python Program to Convert Bytes to a String
Python Set intersection_update()
Python String rsplit()
Python String rpartition()
Python Type Conversion and Type Casting
Python Program to Find the Factors of a Number
Introduction to Machine Learning with Python - Andreas C.Muller & Sarah Guido
Python for Loop
Python Program to Print Hello world!
Python Dictionary copy()
Converting Between an Array and a Set in Java
Python Program to Merge Two Dictionaries
Python help()
Python Program to Print Output Without a Newline
Python Functions
Python String expandtabs()
Python Program to Get the Last Element of the List
Python String isprintable()
Python Program to Generate a Random Number
Python Package
Python abs()
Python String endswith()
Python String istitle()
Python Shallow Copy and Deep Copy
Deep Learning from Scratch - Building with Python form First Principles - Seth Weidman
Python Exception Handling Using try, except and finally statement
Python String lstrip()
Python Dictionary keys()
Python Program to Create a Long Multiline String