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 Safely Create a Nested Directory
Python Program to Iterate Over Dictionaries Using for Loop
Python Program to Split a List Into Evenly Sized Chunks
Python Global Keyword
Python strftime()
Python Exception Handling Using try, except and finally statement
Python Dictionary fromkeys()
Python String isspace()
Python sorted()
Python String upper()
Python List copy()
Python Program to Convert Two Lists Into a Dictionary
Python Object Oriented Programming
Python Program to Parse a String to a Float or Int
Python setattr()
Python chr()
Python String splitlines()
Python String zfill()
Python round()
Python String maketrans()
Python Program to Differentiate Between del, remove, and pop on a List
Python String startswith()
Python Program to Check If Two Strings are Anagram
Python Deep Learning Cookbook - Indra den Bakker
Python object()
Python Program to Check Whether a String is Palindrome or Not
Python String rindex()
Machine Learning Mastery with Python - Understand your data, create accurate models and work project...
Java Program to Implement the Binary Counting Method to Generate Subsets of a Set
Python iter()
Python List extend()
Python type()