8000 ok · machphy/python_programming_@9c562fa · GitHub
[go: up one dir, main page]

Skip to content

Commit 9c562fa

Browse files
committed
ok
1 parent 7a5ef46 commit 9c562fa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sets/set_operations.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
A = {5, 14, 0, 12, 0, 12, 0, 4, 52, 1, 1, 6, 31, 5}
2+
B = {3, 4, 6, 4, 84, 6, 58, 5, 64, 3, 6, 4, 8, 6, 5}
3+
4+
# Performing set operations
5+
c = A & B # Intersection
6+
s = A | B # Union
7+
k = A ^ B # Symmetric difference
8+
9+
# Printing results
10+
print("Intersection (A & B):", c)
11+
print("Union (A | B):", s)
12+
print("Symmetric difference (A ^ B):", k)

0 commit comments

Comments
 (0)
0