<
, <=
부등호로 부분집합 확인https://stackoverflow.com/questions/16579085/how-can-i-verify-if-one-list-is-a-subset-of-another
>>> a = [1, 3, 5]
>>> b = [1, 3, 5, 8]
>>> c = [3, 5, 9]
>>> set(a) <= set(b)
True
>>> set(c) <= set(b)
False
>>> a = ['yes', 'no', 'hmm']
>>> b = ['yes', 'no', 'hmm', 'well']
>>> c = ['sorry', 'no', 'hmm']
>>>
>>> set(a) <= set(b)
True
>>> set(c) <= set(b)
False
issubset()
메소드로 부분집합 확인https://www.programiz.com/python-programming/methods/set/issubset
A = {1, 2, 3}
B = {1, 2, 3, 4, 5}
C = {1, 2, 4, 5}
# Returns True
print(A.issubset(B))
# Returns False
# B is not subset of A
print(B.issubset(A))
# Returns False
print(A.issubset(C))
# Returns True
print(C.issubset(B))