Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check for string in list python

string = "hello"
list = ["bye", "kasd", "hello", "day", "hel"]

if string in list:
    print(f"Found '{string}' in '{list}'!")
else:
	print(f"Couldnt find '{string}' in '{list}'!")
    
>>> Found 'hello' in '["bye", "kasd", "hello", "day", "hel"]'!
Source by utilities.tk #
 
PREVIOUS NEXT
Tagged: #check #string #list #python
ADD COMMENT
Topic
Name
7+7 =