Python: find out if an element in a list has a specific string
<p>I am looking for a specific string in a list; this string is part of a longer string.</p>

<p>Basically i loop trough a text file and add each string in a different element of a list. Now my objective is to scan the whole list to find out if any of the elements string contain a specific string.</p>

<p>example of the source file:</p>

<pre><code>asfasdasdasd
asdasdasdasdasd mystring asdasdasdasd
asdasdasdasdasdasdadasdasdasdas
</code></pre>

<p>Now imagine that each of the 3 string is in an element of the list; and you want to know if the list has the string "my string" in any of it's elements (i don't need to know where is it, or how many occurrence of the string are in the list). I tried to get it with this, but it seems to not find any occurrence</p>

<pre><code>work_list=["asfasdasdasd", "asdasdasdasd my string asdasdasdasd", "asdadadasdasdasdas"]
has_string=False

for item in work_list:
    if "mystring" in work_list:
        has_string=True
        print "***Has string TRUE*****"

print " \n".join(work_list)
</code></pre>

<p>The output will be just the list, and the bool has_string stays False</p>

<p>Am I missing something or am  using the in statement in the wrong way?</p>
