O
O
OlegUnity2020-03-29 21:14:30
Python
OlegUnity, 2020-03-29 21:14:30

How to find data from an array in a string?

How to find data from array in python string.
for example, there is a string
s = 'www.cloud.com'
and there is an array
array = ['cloud','asphalt','crow']
How can I find an element of the array array in string s?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-03-29
@OlegUnity

any(i in s for i in array)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question