Home >>Python Set Methods >Python Set issubset() Method
Python Set issubset() Method in python set returns boolean true if all elements in the set are present in another set and returns false if all elements not present.
Syntax:set.issubset(set)
Parameter | Description |
---|---|
set | It is Required. The set of items to be search for |
a = {"ab", "bc", "cd"}
b = {"fg", "ef", "de", "cd", "bc", "ab"}
c = a.issubset(b)
print(c)
x = {21, 27, 39}
y = {21, 27, 39, 43, 50}
z = {21, 27, 43, 50}
print(x.issubset(y))
print(y.issubset(x))
print(x.issubset(z))
print(z.issubset(y))