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
|
764 Discussions
|
Please Login in order to post a comment
s= int(input()) set1=set(map(int,input().split(" "))) a= int(input()) set2=set(map(int,input().split(" "))) print(len(set1| set2))
i1 = int(input()) l1 = set(input().split()) i2 = int(input()) l2 = set(input().split())
print(len(l1.union(l2)))
n = int(input()) students = set(map(int, input().split())) b = int(input()) be = set(map(int, input().split()))
print(len(students | be))
Here's my code: