Python Set > (greater than) Method
Example
Returns False even if all items in set
y
are present in set x
:
x = {"a", "b", "c"}
y = {"c", "b", "a"}
z = x > y
print(z)
Try it Yourself »
Definition and Usage
The >
returns True if all items of a specified smaller set exists in the current set, otherwise it returns False.
Syntax
set1 > set2
More Examples
Example
Returns True because all items of the smaller set y
is present in the set x
:
x = {"a", "b", "c"}
y = {"b", "a"}
z = x < y
print(z)
Try it Yourself »