Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python check if string is in a list

# Gives True/False if a string is in a list.
input = 'hello'
result = input in ['greetings', 'and', 'hello', 'sir']
print(result)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #check #string #list
ADD COMMENT
Topic
Name
3+1 =