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.
Set .intersection() Operation
Set .intersection() Operation
Sort by
recency
|
467 Discussions
|
Please Login in order to post a comment
n = int(input()) n1=set(map(int,input().split())) m = int(input()) n2=set(map(int,input().split())) print(len(n1 & n2))
For Python3 Platform
N=int(input()) # english newspaper English=set(map(int,input().split()))
N1=int(input()) # french newspaper French=set(map(int,input().split()))
'''Common_subscription=English.intersection(French) print(len(Common_subscription))'''
YOU CAN ALSO USE THIS
METHOD
print(len(English.intersection(French)))