Skip to content

Commit 57a33d1

Browse files
Sanjay_PradeepkumarSanjay_Pradeepkumar
Sanjay_Pradeepkumar
authored and
Sanjay_Pradeepkumar
committed
symmetric_difference_update
symmetric_difference_update info
1 parent 1e8c862 commit 57a33d1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

DataCollectionTypes/sets.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@
9797
s2.symmentric_difference(s1) #{1,2,3,6,7,8}
9898

9999

100+
# symmetric_difference_update() inserts the symmetric differences from this set and another
101+
s1 = {1,2,3,4,5}
102+
s2 = {4,5,6,7,8}
103+
104+
s1.symmetric_difference_update(s2)
105+
s1 # {1,2,3,6,7,8}
106+
107+
# if you do s2.symmetric_difference_update(s1) it will return the same elements as above.
108+
100109

101110
# difference_update() Removes the items in this set that are also included in another, specified set
102111

0 commit comments

Comments
 (0)