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.
Set .symmetric_difference() Operation
Set .symmetric_difference() Operation
Sort by
recency
|
318 Discussions
|
Please Login in order to post a comment
input() english_newspaper = set(input().split()) input() french_newspaper = set(input().split())
print(len(english_newspaper.symmetric_difference(french_newspaper)))
n = int(input()) A = set(input().split()) b = int(input()) B = set(input().split()) print(len(A^B))
Here's my code:
n= int(input()) n_set=set(input().split()) m=int(input()) m_set=set(input().split())
z = n_set.symmetric_difference(m_set) print(len(z))
english = int(input()) english_s = set(list(map(int, input().split()))) france = int(input()) france_s = set(list(map(int, input().split()))) print(len(english_s.symmetric_difference(france_s)))