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 .difference() Operation
- Discussions
Set .difference() Operation
Set .difference() Operation
Sort by
recency
|
360 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.difference(french_newspaper)))
Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(input()) eng = set(map(int, input().split()))
m = int(input()) french = set(map(int, input().split()))
diff = eng.difference(french) print(len(diff))
s=int(input()) set1=set(map(int,input().split(" "))) a= int(input()) set2=set(map(int,input().split(" "))) print(len(set1- set2))
Here's my code:
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.difference(france_s)))