<p>我有以下设置:</p>
<pre><code>stuff = ['apple', 'I like apples today', 'orange', 'oranges and apples guys']
</code></pre>
<p>我想做的是:我想搜索列表中的每个值,看看单词“orange”是否包含在列表索引值中的任何位置。你知道吗</p>
<p>换句话说,我的预期输出是:</p>
<pre><code>orange
oranges and apples guys
</code></pre>
<p>我现在得到的什么都不是。你知道吗</p>
<p>以下是我目前正在做的:</p>
<pre><code>for x in range(0, len(stuff), 1):
if 'orange' in stuff[x] == True:
print('testing to see if this works')
</code></pre>
<p>我不成功,有什么建议吗?你知道吗</p>
<p><strong>编辑#1:</strong></p>
<p>我尝试搜索<code>contains</code>语法以用于<code>re</code>模块,但没有返回任何有用的内容。你知道吗</p>
<p><strong>编辑#2:</strong></p>
<p>对于这样的情况:</p>
<pre><code>stuff = ['crabapple']
'apple' in stuff
False
</code></pre>
<p>“苹果”这个词确实存在,它只是另一个词的一部分。在这种情况下,我也要退回。你知道吗</p>