Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if part of list is in another list python

'''    
    check if list1 contains any elements of list2
'''
result =  any(elem in list1  for elem in list2)
if result:
    print("Yes, list1 contains any elements of list2")    
else :
    print("No, list1 contains any elements of list2")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #part #list #list #python
ADD COMMENT
Topic
Name
1+6 =