Skip to content

Commit

Permalink
python set union() function examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Kumar committed Jan 17, 2019
1 parent 81c386e commit 2747c76
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Python-3/basic_examples/set/set_union.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.union(set2))
print(set2.union(set3))
print(set3.union(set1))

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

0 comments on commit 2747c76

Please sign in to comment.