擅长:python、mysql、java
<p>这里使用这个:</p>
<pre><code>lst2 = list(set([x for x in lst if lst.count(x)==2]))
</code></pre>
<p>如果不想更改订单,请使用此选项:</p>
<pre><code>lst = [595, 595, 344, 344, 628, 628, 628, 353, 353, 353, 353, 353]
lst2=[]
[lst2.append(x) for x in lst if lst.count(x)==2 and x not in lst2]
print(lst2)
</code></pre>