programming-examples/python/Sets/Python program to test whether every element in s is in t and every element in t is in s.py

11 lines
284 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
setx = set(["apple", "mango"])
sety = set(["mango", "orange"])
setz = set(["mango"])
issubset = setx <= sety
print(issubset)
issuperset = setx >= sety
print(issuperset)
issubset = setz <= sety
print(issubset)
issuperset = sety >= setz
print(issuperset)