Comparing Set - is the ability to check if a given subset or superset of another set.
The result is True or False depending on the elements present in sets.
Enter the below code to experience it pratically.
DaysA = set(["Mon","Tue","Wed"])
DaysB = set(["Mon","Tue","Wed","Thu","Fri","Sat","Sun"])
SubsetRes = DaysA <= DaysB
SupersetRes = DaysB >= DaysA
print(SubsetRes)
print(SubsetRes )
output
When the above code is executed here below is the result
True
True
Top comments (0)