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 getattr()
Python repr()
Python compile()
Python Program to Check Armstrong Number
Python Set symmetric_difference()
Python Program to Illustrate Different Set Operations
Python Program to Differentiate Between del, remove, and pop on a List
Python Program to Measure the Elapsed Time in Python
Python String rindex()
Python Program to Calculate the Area of a Triangle
Python Program to Remove Punctuations From a String
APIs in Node.js vs Python - A Comparison
Python zip()
Python Program to Find the Factorial of a Number
Python Deeper Insights into Machine Learning - Sebastian Raschka & David Julian & John Hearty
Python Dictionary copy()
Python Program to Capitalize the First Character of a String
Python Set pop()
Python Dictionary
Python Global Keyword
Python property()
Python Machine Learning Cookbook - Practical solutions from preprocessing to Deep Learning - Chris A...
Python Program to Trim Whitespace From a String
Python Program to Extract Extension From the File Name
Convert a Map to an Array, List or Set in Java
Python pass statement
Python filter()
Python Program to Find the Size (Resolution) of a Image
Python Namespace and Scope
Python Program to Delete an Element From a Dictionary
Python String ljust()
Python datetime