擅长:python、mysql、java
<p>您可以尝试迭代每个项目并使用<code>list comprehension</code>对其进行筛选:</p>
<pre><code>filtered = [i for i in a if 'VOST' not in i]
</code></pre>
<p>上面的代码与下面的代码类似,也是更好的方法:</p>
<pre><code>filtered = []
for i in a:
if 'VOST' not in i:
filtered.append(i)
</code></pre>
<hr/>
<p>如果您想使用<code>remove</code>,您可以遍历每个项,检查要查找的单词是否在项中,然后删除项。您可以尝试以下代码:</p>
<p><strong>注意:<em>这将从原始列表中删除该项,前面的答案将创建名为</em><code>filtered</code>的新列表:</p>
<pre><code>for i in a:
if 'VOST' in i:
a.remove(i)
</code></pre>