1. Overview
The issubset() method returns True if all elements of a set are present in another set (passed as an argument). If not, it returns False.
Set A is said to be the subset of set B if all elements of A are in B.

Here, set A is a subset of B.
The syntax of issubset() is:
A.issubset(B)
The above code checks if A is a subset of B.
2. Return Value from issubset()
issubset() returns
- True if A is a subset of B
- False if A is not a subset of B
3. Example: How issubset() works?
A = {1, 2, 3}
B = {1, 2, 3, 4, 5}
C = {1, 2, 4, 5}
# Returns True
print(A.issubset(B))
# Returns False
# B is not subset of A
print(B.issubset(A))
# Returns False
print(A.issubset(C))
# Returns True
print(C.issubset(B))
Output
True False False True
If you need to check if a set is a superset of another set, you can use issuperset() in Python.
Related posts:
Python Package
Python Program to Check if a Number is Positive, Negative or 0
Python List clear()
Python Program to Create a Countdown Timer
Python String isupper()
Python Machine Learning Second Edition - Sebastian Raschka & Vahid Mirjalili
Python String center()
Python exec()
Python range()
Python Set discard()
Python Program to Safely Create a Nested Directory
Python Program to Randomly Select an Element From the List
Python String rfind()
Python zip()
Python break and continue
Converting Between an Array and a Set in Java
Python Strings
Python Program to Get the Last Element of the List
Python Machine Learning Cookbook - Practical solutions from preprocessing to Deep Learning - Chris A...
Python hasattr()
Python del Statement
Python String strip()
Python Exception Handling Using try, except and finally statement
Python Program to Transpose a Matrix
Applied Text Analysis with Python - Benjamin Benfort & Rebecca Bibro & Tony Ojeda
Python String startswith()
Python print()
Python String isalnum()
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python Program to Illustrate Different Set Operations
Python Set symmetric_difference_update()
Python Program to Print all Prime Numbers in an Interval