A = [1,2,3]
B = [2,3,4]

print set(A)&set(B)