擅长:python、mysql、java
<p>你想看看“cad”是否在字符串列表中的任何字符串中吗?它会像这样:</p>
<pre><code>stringsToSearch = ['blah', 'foo', 'bar', 'abracadabra']
if any('cad' in s for s in stringsToSearch):
# 'cad' was in at least one string in the list
else:
# none of the strings in the list contain 'cad'
</code></pre>