Python‎ > ‎set‎ > ‎

set.update()

http://www.adilwaseem.com/

Definition
Update a set with the union of itself and others.

Syntax
set(x).update(y)

Parameters
x,y=sets

Examples
The output is:
set1={3,1,44,66}
set2={2,3,33,44}
set3=set2.union(set1)
set3.update()
print(set3)

>>> 
{33, 2, 3, 1, 66, 44}
>>> 

Comments