擅长:python、mysql、java
<p>我希望这能解决你的问题:</p>
<pre><code>other_list = ['foo', 'bar ', 'baz ']
filtered_list = [x for x in other_list if (' ' not in x) or (' ' not in other_list[int(other_list.index(x) -1)])]
print filtered_list
</code></pre>
<p>注意:not的位置决定了命令的解释方式。我以为你想要这样的东西。</p>