You are viewing a single comment's thread. Return to all comments →
e = int(input()) #Number of students who have subscribed to the English newspaper. e1 = set(input().split(' ')) #Space separated roll numbers of students subscribed to the English newspaper. f = int(input()) #Number of students who have subscribed to the French newspaper. f1 = set(input().split(' ')) #Space separated roll numbers of students subscribed to the French newspaper. s = e1.intersection(f1) #Intersection of e1 and f1 print(len(s)) #Count of e1.intersection(f1)
Seems like cookies are disabled on this browser, please enable them to open this website
Set .intersection() Operation
You are viewing a single comment's thread. Return to all comments →