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
- Set .union() Operation
- Discussions
Set .union() Operation
Set .union() Operation
Sort by
recency
|
768 Discussions
|
Please Login in order to post a comment
code
input() english = set(input().split()) input() french = set(input().split())
print(len(english.union(french)))
input() english_newspaper = set(input().split()) input() french_newspaper = set(input().split())
print(len(english_newspaper.union(french_newspaper)))
n = int(input()) eng_sub = set(map(int, input().split()))
m = int(input()) french_sub = set(map(int, input().split()))
union_all = eng_sub.union(french_sub) print(len(union_all))
s= int(input()) set1=set(map(int,input().split(" "))) a= int(input()) set2=set(map(int,input().split(" "))) print(len(set1| set2))