Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python check if all elements exist in another list

fruits1 = ['Mango','orange','apple','jackfruit']
fruits2 = ['Mango','orange','apple','jackfruit']
new_list=  all(item in fruits1 for item in fruits2)
if new_list is True:
    print("True")    
else :
    print("False")
Source by pythonguides.com #
 
PREVIOUS NEXT
Tagged: #Python #check #elements #exist #list
ADD COMMENT
Topic
Name
7+1 =