We will continue to summarize the set in Part 2.
It seems that the following are typical ones (is this all?).
--Subset
#Subset A is contained in the large set U
>>> U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
>>> A = {2, 3, 9, 10}
>>> A <= U
True
--Complementary set (what was played from the subset?) Obtained by the difference set described later. --Intersection
#Intersection of two sets
>>> U = {1, 2, 6, 10}
>>> A = {7, 3, 6, 9}
>>> U & A
{6}
>>>
--Union
#Union sum of sets
>>> U = {1, 2, 6, 10}
>>> A = {7, 3, 6, 9}
>>> U | A
{1, 2, 3, 6, 7, 9, 10}
#Same element counts as one
--Complement
#Complement Subtract common elements from one set
>>> U = {1, 2, 6, 10}
>>> A = {7, 3, 6, 9}
>>> U - A
{1, 2, 10}
--Target difference
#Remove common elements from two sets of symmetric differences
>>> U = {1, 2, 6, 10}
>>> A = {7, 3, 6, 9}
>>> U ^ A
{1, 2, 3, 7, 9, 10}
--Empty set
#There are no result elements of the empty set operation
>>> U = {1, 2, 3}
>>> A = {4, 5, 6}
>>> U & A
set()
Grouping the above sets under clear conditions is called __set operation. __
Recommended Posts