Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python list include

# List of string 
listOfStrings = ['Hi' , 'hello', 'at', 'this', 'there', 'from']

'''    
    check if element exist in list using 'in'
'''
if 'at' in listOfStrings :
    print("Yes, 'at' found in List : " , listOfStrings)
    
'''    
    check if element NOT exist in list using 'in'
'''
if 'time' not in listOfStrings :
    print("Yes, 'time' NOT found in List : " , listOfStrings)
 
PREVIOUS NEXT
Tagged: #python #list #include
ADD COMMENT
Topic
Name
8+5 =