Skip to content

Commit e9c1fe8

Browse files
Added a .py file that demonstrates the use of '.difference_update()' for checking the difference between two (2) sets and updating one (1) of the sets with the difference in Python.
1 parent 65d6685 commit e9c1fe8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

027.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set1 = {"128gb", "256gb", "512gb"}
2+
set2 = {"256gb", "512gb", "1tb"}
3+
4+
set1.difference_update(set2)
5+
6+
print(set1)

0 commit comments

Comments
 (0)