Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python 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 #string #list
ADD COMMENT
Topic
Name
9+2 =