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
2019-11-15 12:59:38 +01:00

11 lines
284 B
Python

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)