Skip to content

Commit ae66896

Browse files
authored
Create basic set operations
1 parent 438f337 commit ae66896

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

basic set operations

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
A = {1, 2, 3, 4, 5};
2+
B = {8, 2, 0, 4, 6};
3+
4+
# union
5+
print("Union :", A | B)
6+
7+
# intersection
8+
print("Intersection :", A & B)
9+
10+
# difference
11+
print("Difference :", A - B)
12+
13+
# symmetric difference
14+
print("Symmetric difference :", A ^ B)
15+

0 commit comments

Comments
 (0)