- issubset() is a python function which is applicable only on set data types.
- It compare the two set and check whether one set is subset of another set or not.
Syntax-
set1.issubset(set2)
- It return True if set1 is subset of set2.
- It return False if set1 is not subset of set2.
Example
set1 is {1,2}
set2 is {1,2,3,4}
set1.issubset(set2) will return True.
program-
set1={1,2,3,4}
set2={1,2,3,4,5,6,7,8,9}
print("Set1 is",set1)
print("Set2 is",set2)
print(set1.issubset(set2))
print(set2.issubset(set1))
Set1 is {1, 2, 3, 4}
Set2 is {1, 2, 3, 4, 5, 6, 7, 8, 9}
True
False