Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

# find the common elements in the list.

# find the common elements in the list.
l1 = ['a','b','c','d','e','f','g','h','a','b']
l2 = ['e','f','g','h','i','j']
s1=set(l1).intersection(l2)
print(list(s1))

#['g', 'f', 'e', 'h']
 
PREVIOUS NEXT
Tagged: #find #common #elements
ADD COMMENT
Topic
Name
7+8 =