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 classmethod()
Python List extend()
Python Program to Check Leap Year
Python Program to Count the Occurrence of an Item in a List
Python Program to Find Armstrong Number in an Interval
Python if...else Statement
Python type()
Natural Language Processing with Python - Steven Bird & Ewan Klein & Edward Loper
Deep Learning with Python - Francois Chollet
Building Chatbots with Python Using Natural Language Processing and Machine Learning - Sumit Raj
Python Dictionary
Python pass statement
JavaScript Map and Set
Python Program to Convert Celsius To Fahrenheit
Python Program to Differentiate Between del, remove, and pop on a List
Python Iterators
Python for Programmers with introductory AI case studies - Paul Deitel & Harvey Deitel
Python Program to Find Sum of Natural Numbers Using Recursion
Python Program to Display the multiplication Table
Python Dictionary items()
Python String isnumeric()
Python String replace()
Python Program to Concatenate Two Lists
Python super()
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python Program to Convert Kilometers to Miles
Python Program to Check If Two Strings are Anagram
Python Operators
Python Program to Extract Extension From the File Name
Python bytes()
Python Set intersection()
Python while Loop