Python‎ > ‎set‎ > ‎

set.intersection_update()

http://www.adilwaseem.com/

Definition
Update a set with the intersection of itself and another.

Syntax
set(x).intersection_update(y)

Parameters
x,y=sets

Examples
The example is:
set1={3,45,344,66}
set2={1,44,66}
set3=set1.intersection(set2)
set1.intersection_update(set2)
print("Please print common elements of set1 and set2", set1)

>>> 
Please print common elements of set1 and set2 {66}
>>>

Comments