Reading Time: 1 minutes
Finding common elements in lists in Python
Write a Python program for finding common elements in lists.
Finding common elements in lists
listOne = [2, 4, 6, 8, 10, 12] listTwo = [3, 6, 9, 12, 15] commonElements = list( set(listOne) & set(listTwo) ) # Intersection operator & of sets print(commonElements) [12, 6]