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
|
709 Discussions
|
Please Login in order to post a comment
n = int(input()) set_n = set(input().split()) b = int(input()) set_b = set(input().split())
print(len(set_n.union(set_b)))
here is my code:
eng = int(input())
eng_roll = set(map(int, input().split()))
french = int(input())
french_roll = set(map(int, input().split()))
union = eng_roll.union(french_roll)
print(len(union))