Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if value is in list python

l1 = [1]
l2 = [2,3,4]

if len(set(l1).intersection(set(l2)))==0:
    print('1 is not in the list (l2)')
else: # len()>0
    print('1 is in the list (l2)')
 
PREVIOUS NEXT
Tagged: #check #list #python
ADD COMMENT
Topic
Name
5+4 =