Skip to content

Commit

Permalink
python set difference() function examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Kumar committed Jan 17, 2019
1 parent cc67456 commit 81c386e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Python-3/basic_examples/set/set_difference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set1 = {1, 2, 3, 4}
set2 = {2, 3, 5, 6}
set3 = {3, 4, 6, 7}

print(set1.difference(set2))
print(set2.difference(set3))
print(set3.difference(set1))

print(set1.difference(set2, set3))
# OR
print(set1.difference(set2).difference(set3))

0 comments on commit 81c386e

Please sign in to comment.