We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- Symmetric Difference
- Discussions
Symmetric Difference
Symmetric Difference
Sort by
recency
|
1209 Discussions
|
Please Login in order to post a comment
def sym_diff(): s1=input() a=input() a1=a.split(" ") set1={int(i) for i in a1} s2=input() b=input() a2=b.split(" ") set2={int(i) for i in a2} return sorted(set1-set2| set2 - set1) op=sym_diff() for i in op: print(i)
m = int(input())
a = set(map(int, input().split()[:m]))
n = int(input())
b = set(map(int, input().split()[:n]))
result = a ^ b
for item in sorted(result):