Skip to content

Commit 65d6685

Browse files
Added a .py file that demonstrates the use of '.difference_update()' for checking and updating a set with a difference in Python.
1 parent 56a00fc commit 65d6685

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

026.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set1 = {"apple", "banana", "cherry"}
2+
set2 = {"google", "microsoft", "apple"}
3+
4+
set1.difference_update(set2)
5+
6+
print(set1)

0 commit comments

Comments
 (0)