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
|
763 Discussions
|
Please Login in order to post a comment
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:
english = int(input()) english_std = set(list(map(int, input().split()))) france = int(input()) france_std = set(list(map(int, input().split()))) print(len(english_std.union(france_std)))