Definition 1.2.1. Intersection.
Let and be sets. The intersection of and (denoted by ) is the set of all elements that are in both and That is,
Set( )
, the order of elements appearing in the list and their duplication are ignored. For example, L1 and L2 are two different lists, but notice how as sets they are considered equal:xxxxxxxxxx
L1=[3,6,9,0,3]
L2=[9,6,3,0,9]
[L1==L2, Set(L1)==Set(L2) ]
xxxxxxxxxx
A=Set(srange(5,50,5))
B=Set(srange(6,50,6))
[A,B]
xxxxxxxxxx
[10 in A, 10 in B]
xxxxxxxxxx
A & B
xxxxxxxxxx
[A.symmetric_difference(B),A.difference(B),B.difference(A)]