Opérations Frozenset Python
# Frozensets
# initialize A , B
and C
A = frozenset([4, 3, 2, 1])
B = frozenset([7, 6, 5, 4])
C = frozenset([5, 4])
# copy
D = A.copy()
print("Copy of frozen set: ", D)
# union
print("Union of frozen set: ", A.union(B))
# intersection
print("Intersection of frozen set: ", A.intersection(B))
# difference
print("Difference of frozen set: ", A.difference(B))
# symmetric_difference
print("symmetric_difference of frozen set: ", A.symmetric_difference(B))
# isdisjoint() method
print("disjoint of frozen set: ", A.isdisjoint(C))
# issubset() method
print("subset of frozen set: ", C.issubset(B))
Outrageous Ostrich