Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python list contain list

#There's an all() and any() function to do this. To check if big contains ALL elements in small

result = all(elem in big for elem in small)
#To check if small contains ANY elements in big

result = any(elem in big for elem in small)
#the variable result would be boolean (TRUE/FALSE).
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #list #list
ADD COMMENT
Topic
Name
4+2 =