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
Post a Comment