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 print()
Python id()
Python Program to Create Pyramid Patterns
Python Program to Find Armstrong Number in an Interval
Python len()
Python List copy()
Python Program to Find the Factors of a Number
Python Numbers, Type Conversion and Mathematics
Python List count()
Python ord()
JavaScript Map and Set
Python object()
Python Sets
Python Program to Create a Long Multiline String
Python Machine Learning Cookbook - Practical solutions from preprocessing to Deep Learning - Chris A...
Python pow()
Python String format_map()
Python List extend()
Python Statement, Indentation and Comments
Introduction to Machine Learning with Python - Andreas C.Muller & Sarah Guido
Python Modules
Python Program to Make a Simple Calculator
Python String join()
Python String isspace()
Python Program to Copy a File
Python __import__()
Python repr()
Python Program to Make a Flattened List from Nested List
Python Program to Differentiate Between del, remove, and pop on a List
Python Program to Print all Prime Numbers in an Interval
Python Program to Compute the Power of a Number
Python divmod()