python - List of strings in string -



python - List of strings in string -

how can write look in python checks if string contains of strings provided. this:

s = 'winter summer spring fall' # fall , spring i_like = 'fall', 'spring' in s

use built in any function:

i_like = any(i in s in ('fall', 'spring'))

this checks if of elements in tuple in string.

python

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

r - url in CRAN extension manual -

asp.net - .NET Control.ID property inconsistency -