“string na lista python” Respostas de código

string na lista 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"]'!
ProxyBlade

Python Find String na lista

list1 = ["a", "b", "c"]

isBInList = "b" in list1 # True
Shy Stag

Respostas semelhantes a “string na lista python”

Perguntas semelhantes a “string na lista python”

Mais respostas relacionadas para “string na lista python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código