判断是否为另一个集合的子集或超集,也可以用 <=、>=。
<=
>=
other
布尔值
need = {"read"} have = {"read", "write"} print(need.issubset(have), have >= need)
True True