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 utilities.tk #
 
PREVIOUS NEXT
Tagged: #python #check #string #list
ADD COMMENT
Topic
Name
1+2 =